adjacent_cell Function

private function adjacent_cell(mesh, fid, c) result(nb)

Arguments

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

Return Value integer


Source Code

   integer function adjacent_cell(mesh, fid, c) result(nb)
      type(mesh_t), intent(in) :: mesh
      integer, intent(in) :: fid, c

      nb = 0
      if (mesh%faces(fid)%owner == c) then
         nb = mesh%faces(fid)%neighbor
         if (nb <= 0) nb = mesh%faces(fid)%periodic_neighbor
      else if (mesh%faces(fid)%neighbor == c .or. mesh%faces(fid)%periodic_neighbor == c) then
         nb = mesh%faces(fid)%owner
      end if
   end function adjacent_cell