Centralize edge topology and model validation

This commit is contained in:
shenw
2026-06-22 20:48:43 +08:00
parent 53a16c0074
commit 30c2525bc7
6 changed files with 382 additions and 43 deletions
+8 -12
View File
@@ -1,6 +1,7 @@
module fem_database
use fem_precision
use fem_error
use fem_element_topology
implicit none
integer :: nnode = 0
@@ -621,7 +622,7 @@ contains
node = elem_conn(local_node, elem)
if (node .ge. 1 .and. node .le. nnode) then
has_translation(node) = .true.
if (is_shell_element(elem_type(elem))) has_rotation(node) = .true.
if (element_is_shell(elem_type(elem))) has_rotation(node) = .true.
end if
end do
end do
@@ -975,6 +976,12 @@ contains
integer :: elem
do elem = 1, nelem
if (.not. element_is_supported(elem_type(elem))) then
call error_set(FEM_ERR_MESH, 'unsupported element type', ierr)
return
end if
call element_validate_node_count(elem_type(elem), elem_nnode(elem), ierr)
if (ierr .ne. FEM_SUCCESS) return
if (elem_mat(elem) .le. 0) then
call error_set(FEM_ERR_INPUT, 'element has no material assignment', ierr)
return
@@ -1085,17 +1092,6 @@ contains
end if
end function elem_or_elset_exists
logical function is_shell_element(type_name)
character(len=*), intent(in) :: type_name
character(len=ELEM_TYPE_LEN) :: local_type
local_type = adjustl(type_name)
is_shell_element = .false.
if (len_trim(local_type) .ge. 1) then
is_shell_element = local_type(1:1) .eq. 'S'
end if
end function is_shell_element
subroutine database_finalize(ierr)
integer, intent(out) :: ierr