Determines the outward unit normal relative to a specific cell.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(mesh_t), | intent(in) | :: | mesh | |||
| integer, | intent(in) | :: | face_id | |||
| integer, | intent(in) | :: | cell_id |
pure function outward_normal(mesh, face_id, cell_id) result(nvec) type(mesh_t), intent(in) :: mesh integer, intent(in) :: face_id integer, intent(in) :: cell_id real(rk) :: nvec(3) if (mesh%faces(face_id)%owner == cell_id) then nvec = mesh%faces(face_id)%normal else nvec = -mesh%faces(face_id)%normal end if end function outward_normal