Returns the neighbor cell index, accounting for periodic connectivity.
If the face is on a periodic boundary, this returns the periodic_neighbor
stored in the face structure. Otherwise, it returns the standard neighbor.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(mesh_t), | intent(in) | :: | mesh |
The computational mesh. |
||
| type(bc_set_t), | intent(in) | :: | bc |
The active BC set. |
||
| integer, | intent(in) | :: | face_id |
Global index of the face. |
||
| integer, | intent(in) | :: | cell_id |
Index of the cell requesting the neighbor. |
integer function face_effective_neighbor(mesh, bc, face_id, cell_id) result(neighbor) type(mesh_t), intent(in) :: mesh type(bc_set_t), intent(in) :: bc integer, intent(in) :: face_id integer, intent(in) :: cell_id if (mesh%faces(face_id)%owner == cell_id) then neighbor = mesh%faces(face_id)%neighbor else neighbor = mesh%faces(face_id)%owner end if if (neighbor == 0 .and. is_periodic_face(mesh, bc, face_id)) then neighbor = mesh%faces(face_id)%periodic_neighbor end if end function face_effective_neighbor