append_cell_face Subroutine

private subroutine append_cell_face(m, cell_id, face_id)

Helper to safely add a face to a cell's local face list.

Arguments

Type IntentOptional Attributes Name
type(mesh_t), intent(inout) :: m
integer, intent(in) :: cell_id
integer, intent(in) :: face_id

Source Code

   subroutine append_cell_face(m, cell_id, face_id)
      type(mesh_t), intent(inout) :: m
      integer, intent(in) :: cell_id
      integer, intent(in) :: face_id

      if (m%ncell_faces(cell_id) >= max_cell_faces) then
         call fatal_error('mesh_io', 'cell has more than six faces')
      end if

      m%ncell_faces(cell_id) = m%ncell_faces(cell_id) + 1
      m%cell_faces(m%ncell_faces(cell_id), cell_id) = face_id
   end subroutine append_cell_face