Release FemLite 0.3.0
FemLite CI / build-test (push) Has been cancelled

This commit is contained in:
shenw
2026-06-23 19:28:44 +08:00
parent f838ccc099
commit be02684827
74 changed files with 11618 additions and 201 deletions
+91
View File
@@ -3,6 +3,7 @@ program test_shell_internal
use fem_error
use fem_database
use fem_element_internal
use fem_element_stiffness
use fem_quadrature
use fem_shape_functions
implicit none
@@ -17,6 +18,7 @@ program test_shell_internal
call check_s3_membrane_patch()
call check_s4_membrane_patch()
call check_s4_j2_membrane_plastic()
call check_s6_membrane_patch()
call check_s8_membrane_patch()
call check_shear_patch('S3', 1, 200)
@@ -68,6 +70,33 @@ contains
if (ierr .ne. FEM_SUCCESS) call fail(190)
end subroutine check_s4_membrane_patch
subroutine check_s4_j2_membrane_plastic()
integer :: ierr
integer, parameter :: MAX_SHELL_TEST_DOF = 60
integer :: elem_dofs(MAX_SHELL_TEST_DOF)
integer :: n_elem_dof
real(rk) :: ke(MAX_SHELL_TEST_DOF,MAX_SHELL_TEST_DOF)
call setup_s4_j2(ierr)
if (ierr .ne. FEM_SUCCESS) call fail(451)
call apply_x_extension(EXX)
call element_compute_internal_force(ierr, 0.1_rk)
if (ierr .ne. FEM_SUCCESS) call fail(452)
if (elem_status(1) .ne. 0) call fail(453)
if (statev(1,1) .le. ZERO) call fail(454)
if (statev(22,1) .le. ZERO) call fail(455)
if (abs(stress(1,1)) .ge. YOUNG * EXX) call fail(456)
call element_linear_stiffness(1, elem_dofs, n_elem_dof, ke, ierr)
if (ierr .ne. FEM_SUCCESS) call fail(457)
if (n_elem_dof .ne. 24) call fail(458)
call check_matrix_symmetric(ke, n_elem_dof, 459)
call database_finalize(ierr)
if (ierr .ne. FEM_SUCCESS) call fail(460)
end subroutine check_s4_j2_membrane_plastic
subroutine check_s6_membrane_patch()
integer :: ierr
@@ -252,6 +281,54 @@ contains
call database_assign_dofs(ierr)
end subroutine setup_s4
subroutine setup_s4_j2(ierr)
integer, intent(out) :: ierr
call database_allocate_model(4, 1, 0, 1, 0, 1, 1, 1, 1, &
0, 0, 0, 0, 0, ierr)
if (ierr .ne. FEM_SUCCESS) return
node_id_ext(1) = 1
node_id_ext(2) = 2
node_id_ext(3) = 3
node_id_ext(4) = 4
coord0(:,1) = (/ ZERO, ZERO, ZERO /)
coord0(:,2) = (/ ONE, ZERO, ZERO /)
coord0(:,3) = (/ ONE, ONE, ZERO /)
coord0(:,4) = (/ ZERO, ONE, ZERO /)
coord = coord0
elem_id_ext(1) = 1
elem_type(1) = 'S4'
elem_nnode(1) = 4
elem_conn(:,1) = 0
elem_conn(1:4,1) = (/ 1, 2, 3, 4 /)
elem_mat(1) = 1
elem_sec(1) = 1
elset_name(1) = 'EALL'
elset_start(1) = 1
elset_count(1) = 1
elset_items(1) = 1
mat_name(1) = 'MAT'
mat_density(1) = ONE
mat_e(1) = YOUNG
mat_nu(1) = POISSON
mat_plastic_model(1) = 'J2'
mat_plastic_start(1) = 1
mat_plastic_count(1) = 1
mat_plastic_stress(1) = 0.05_rk
mat_plastic_strain(1) = ZERO
section_type(1) = 'SHELL'
section_elset_name(1) = 'EALL'
section_material_name(1) = 'MAT'
section_thickness(1) = THICKNESS
call database_assign_dofs(ierr)
end subroutine setup_s4_j2
subroutine setup_s6(ierr)
integer, intent(out) :: ierr
@@ -553,6 +630,20 @@ contains
end do
end subroutine check_vector_close
subroutine check_matrix_symmetric(mat, n, code)
real(rk), intent(in) :: mat(:,:)
integer, intent(in) :: n
integer, intent(in) :: code
integer :: i
integer :: j
do i = 1, n
do j = 1, n
if (abs(mat(i,j) - mat(j,i)) .gt. 1.0e-8_rk) call fail(code)
end do
end do
end subroutine check_matrix_symmetric
subroutine fail(code)
integer, intent(in) :: code