Add solid linear stiffness matrices

This commit is contained in:
shenw
2026-06-22 21:55:56 +08:00
parent 594af0784f
commit 4f716ad0b1
5 changed files with 560 additions and 1 deletions
+11 -1
View File
@@ -2,6 +2,7 @@ module fem_assembly_csr
use fem_precision
use fem_error
use fem_database
use fem_element_topology
use fem_sparse_csr
implicit none
@@ -25,6 +26,7 @@ contains
integer :: local_node
integer :: node
integer :: dof_num
integer :: last_dof
integer :: dof
n_elem_dof = 0
@@ -42,6 +44,14 @@ contains
call error_set(FEM_ERR_INTERNAL, 'assembly requires allocated element connectivity', ierr)
return
end if
if (element_is_solid(elem_type(elem))) then
last_dof = 3
else if (element_is_shell(elem_type(elem))) then
last_dof = NDOF_NODE
else
call error_set(FEM_ERR_MESH, 'unsupported element type for assembly dofs', ierr)
return
end if
do local_node = 1, elem_nnode(elem)
node = elem_conn(local_node, elem)
@@ -49,7 +59,7 @@ contains
call error_set(FEM_ERR_MESH, 'assembly element references invalid node', ierr)
return
end if
do dof_num = 1, NDOF_NODE
do dof_num = 1, last_dof
dof = dof_id(dof_num, node)
if (dof .gt. 0) then
if (n_elem_dof .ge. size(elem_dofs)) then