validate_hex_connectivity Subroutine

private subroutine validate_hex_connectivity(mesh)

Performs sanity checks on hex connectivity before writing output.

Arguments

Type IntentOptional Attributes Name
type(mesh_t), intent(in) :: mesh

Calls

proc~~validate_hex_connectivity~~CallsGraph proc~validate_hex_connectivity mod_output::validate_hex_connectivity proc~fatal_error mod_kinds::fatal_error proc~validate_hex_connectivity->proc~fatal_error

Source Code

   subroutine validate_hex_connectivity(mesh)
      type(mesh_t), intent(in) :: mesh

      integer :: c, n, node_id

      if (mesh%npoints <= 0) then
         call fatal_error('output', 'mesh has no points')
      end if

      if (mesh%ncells <= 0) then
         call fatal_error('output', 'mesh has no cells')
      end if

      do c = 1, mesh%ncells
         do n = 1, 8
            node_id = mesh%cells(c)%nodes(n)

            if (node_id < 1 .or. node_id > mesh%npoints) then
               call fatal_error('output', 'cell connectivity has node id outside 1..npoints')
            end if
         end do
      end do
   end subroutine validate_hex_connectivity