Add lumped mass for shell element family

This commit is contained in:
shenw
2026-06-22 22:37:36 +08:00
parent cd6c6ac4e4
commit fb85739ed3
3 changed files with 270 additions and 4 deletions
+59 -4
View File
@@ -68,17 +68,18 @@ contains
nodal_mass = elem_mass / real(nlocal, rk)
call add_translational_mass(elem, nodal_mass)
case ('S4')
case ('S3', 'S4', 'S6', 'S8')
call element_validate_node_count(etype, nlocal, ierr)
if (ierr .ne. FEM_SUCCESS) return
thickness = section_thickness(sec)
if (thickness .le. ZERO) then
call error_set(FEM_ERR_INPUT, 'S4 section thickness must be positive', ierr)
call error_set(FEM_ERR_INPUT, 'shell section thickness must be positive', ierr)
return
end if
area = shell4_area(elem)
call shell_area_by_quadrature(elem, area, ierr)
if (ierr .ne. FEM_SUCCESS) return
if (area .le. ZERO) then
call error_set(FEM_ERR_MESH, 'S4 element has non-positive area', ierr)
call error_set(FEM_ERR_MESH, 'shell element has non-positive area', ierr)
return
end if
elem_mass = density * area * thickness
@@ -188,6 +189,60 @@ contains
ierr = FEM_SUCCESS
end subroutine solid_volume_by_quadrature
subroutine shell_area_by_quadrature(elem, area, ierr)
integer, intent(in) :: elem
real(rk), intent(out) :: area
integer, intent(out) :: ierr
integer, parameter :: MAX_QP = 16
real(rk) :: xi(NDIM,MAX_QP)
real(rk) :: weight(MAX_QP)
real(rk) :: nshape(MAX_NEN)
real(rk) :: dndr(NDIM,MAX_NEN)
real(rk) :: tangent1(NDIM)
real(rk) :: tangent2(NDIM)
real(rk) :: normal(NDIM)
real(rk) :: jac_area
character(len=ELEM_TYPE_LEN) :: etype
integer :: gp
integer :: npoint
integer :: node
integer :: local_node
etype = adjustl(elem_type(elem))
call quadrature_get_rule(etype, MAX_QP, npoint, xi, weight, ierr)
if (ierr .ne. FEM_SUCCESS) return
area = ZERO
do gp = 1, npoint
call shape_evaluate(etype, xi(:,gp), nshape, dndr, ierr)
if (ierr .ne. FEM_SUCCESS) return
tangent1 = ZERO
tangent2 = ZERO
do local_node = 1, elem_nnode(elem)
node = elem_conn(local_node, elem)
tangent1 = tangent1 + coord0(:,node) * dndr(1,local_node)
tangent2 = tangent2 + coord0(:,node) * dndr(2,local_node)
end do
call cross3(tangent1, tangent2, normal)
jac_area = sqrt(sum(normal * normal))
if (jac_area .le. ZERO) then
call error_set(FEM_ERR_MESH, 'shell element has non-positive surface Jacobian', ierr)
return
end if
area = area + jac_area * weight(gp)
end do
if (area .le. ZERO) then
call error_set(FEM_ERR_MESH, 'shell element has non-positive area', ierr)
return
end if
ierr = FEM_SUCCESS
end subroutine shell_area_by_quadrature
real(rk) function shell4_area(elem)
integer, intent(in) :: elem
real(rk) :: a(NDIM)