Complete V5 acceptance milestone

This commit is contained in:
shenw
2026-06-26 12:54:40 +08:00
parent 26639d8dc2
commit a01a4fda24
105 changed files with 8694 additions and 8922 deletions
+26
View File
@@ -6,6 +6,9 @@ program test_solver_implicit
use fem_boundary
use fem_element_mass
use fem_solver_implicit
use fem_linear_solver_cg, only: linear_solver_get_diagnostics
use fem_sparse_csr_diagnostics, only: CSR_CLASS_GENERAL, &
CSR_CLASS_SPD_CAND
implicit none
real(rk), parameter :: TOL = 1.0e-10_rk
@@ -40,6 +43,7 @@ contains
if (ierr .ne. FEM_SUCCESS) call fail(2)
if (iter .le. 0 .or. iter .gt. 5) call fail(3)
if (res_norm .gt. TOL) call fail(4)
call check_solver_diag(4000)
dof = dof_id(1,2)
expected = 5.0_rk / 6.0_rk
@@ -223,6 +227,7 @@ contains
if (ierr .ne. FEM_SUCCESS) call fail(72)
if (iter .le. 0 .or. iter .gt. 5) call fail(73)
if (res_norm .gt. TOL) call fail(74)
call check_solver_diag(4100)
dof = dof_id(1,2)
call check_close(u(dof), 15.0_rk / 73.0_rk, 75)
@@ -364,6 +369,7 @@ contains
if (ierr .ne. FEM_SUCCESS) call fail(133)
if (iter .le. 0 .or. iter .gt. 5) call fail(134)
if (res_norm .gt. TOL) call fail(135)
call check_solver_diag(4200)
dof = dof_id(1,2)
call check_close(u(dof), 3.0_rk / 98.0_rk, 136)
@@ -592,6 +598,26 @@ contains
if (abs(actual - expected) .gt. TOL) call fail(code)
end subroutine check_close
subroutine check_solver_diag(code_base)
integer, intent(in) :: code_base
integer :: ierr
integer :: matrix_class
integer :: status_code
real(rk) :: initial_residual
real(rk) :: final_residual
real(rk) :: relative_residual
call linear_solver_get_diagnostics(matrix_class, initial_residual, &
final_residual, relative_residual, status_code, ierr)
if (ierr .ne. FEM_SUCCESS) call fail(code_base)
if (matrix_class .lt. CSR_CLASS_GENERAL .or. &
matrix_class .gt. CSR_CLASS_SPD_CAND) call fail(code_base + 1)
if (status_code .ne. LS_STATUS_CONVERGED) call fail(code_base + 2)
if (initial_residual .le. final_residual) call fail(code_base + 3)
if (final_residual .gt. 1.0e-8_rk) call fail(code_base + 4)
if (relative_residual .gt. 1.0e-8_rk) call fail(code_base + 5)
end subroutine check_solver_diag
subroutine fail(code)
integer, intent(in) :: code