mesh_neighbor_for_cell Function

private function mesh_neighbor_for_cell(mesh, face_id, cell_id) result(nb)

Returns the mesh neighbor, using stored periodic links when present.

Arguments

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

Return Value integer


Source Code

   integer function mesh_neighbor_for_cell(mesh, face_id, cell_id) result(nb)
      type(mesh_t), intent(in) :: mesh
      integer, intent(in) :: face_id, cell_id

      if (mesh%faces(face_id)%owner == cell_id) then
         nb = mesh%faces(face_id)%neighbor
      else
         nb = mesh%faces(face_id)%owner
      end if

      if (nb == 0 .and. mesh%faces(face_id)%periodic_neighbor > 0) then
         nb = mesh%faces(face_id)%periodic_neighbor
      end if
   end function mesh_neighbor_for_cell