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


Called by

proc~~mesh_neighbor_for_cell~~CalledByGraph proc~mesh_neighbor_for_cell mod_mpi_flow::mesh_neighbor_for_cell proc~setup_cell_halo mod_mpi_flow::setup_cell_halo proc~setup_cell_halo->proc~mesh_neighbor_for_cell proc~flow_mpi_initialize mod_mpi_flow::flow_mpi_initialize proc~flow_mpi_initialize->proc~setup_cell_halo program~lowmach_react_hex lowmach_react_hex program~lowmach_react_hex->proc~flow_mpi_initialize

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