Advance V5 nonlinear benchmarks and shell solver

This commit is contained in:
shenw
2026-06-27 16:43:00 +08:00
parent a2a11179d9
commit db68340aaf
84 changed files with 38720 additions and 971 deletions
+15 -3
View File
@@ -6,6 +6,7 @@ module fem_linear_solver_dispatch
use fem_sparse_csr_diagnostics, only: csr_profile, csr_analyze, &
csr_residual_norm
use fem_linear_solver_iterative
use fem_linear_solver_dense
implicit none
private
@@ -78,13 +79,22 @@ contains
case (LSOLVER_GMRES)
call linear_gmres_solve(a, b, x, max_iter, tol, iter, res_norm, &
ierr, preconditioner)
case (LSOLVER_DENSE)
call linear_dense_solve(a, b, x, iter, res_norm, ierr)
case default
iter = 0
res_norm = ZERO
call error_set(FEM_ERR_SOLVER, 'unknown linear solver method', ierr)
end select
if (ierr .eq. FEM_SUCCESS) status = LS_STATUS_CONVERGED
if (ierr .ne. FEM_SUCCESS) then
call linear_solver_record(method, preconditioner, iter, res_norm, &
status, matrix_class, initial_resid, &
final_rel_resid)
return
end if
status = LS_STATUS_CONVERGED
call csr_residual_norm(a, b, x, final_resid, final_rel_resid, &
audit_ierr)
if (audit_ierr .eq. FEM_SUCCESS) res_norm = final_resid
@@ -99,12 +109,14 @@ contains
integer, intent(out) :: ierr
if (method .ne. LSOLVER_CG .and. method .ne. LSOLVER_BICGSTAB .and. &
method .ne. LSOLVER_GMRES) then
method .ne. LSOLVER_GMRES .and. method .ne. LSOLVER_DENSE) then
call error_set(FEM_ERR_SOLVER, 'invalid linear solver method', ierr)
return
end if
if (preconditioner .ne. LPRECOND_NONE .and. &
preconditioner .ne. LPRECOND_JACOBI) then
preconditioner .ne. LPRECOND_JACOBI .and. &
preconditioner .ne. LPRECOND_GAUSS_SEIDEL .and. &
preconditioner .ne. LPRECOND_ILU0) then
call error_set(FEM_ERR_SOLVER, 'invalid linear preconditioner', ierr)
return
end if