Function t8_forest_same_level_leaf_face_neighbor_index
Defined in File t8_forest_general.h
Function Documentation
-
t8_locidx_t t8_forest_same_level_leaf_face_neighbor_index(const t8_forest_t forest, const t8_locidx_t element_index, const int face_index, const t8_gloidx_t global_treeid, int *dual_face)
Given a leaf element or ghost index in “all local elements + ghosts” enumeration compute the index of the face neighbor of the element - provided that only one or no face neighbors exists.
HANDLE WITH CARE. DO NOT CALL IF THE FOREST IS NOT UNIFORM.
Note
Do not call if you are unsure about the number of face neighbors. In particular if the forest is not uniform.
- Parameters:
forest – [in] The forest. Must be committed.
element_index – [in] Index of an element in forest. Must have only one or no facen neighbors across the given face. 0 <= element_index < num_local_elements + num_ghosts
face_index – [in] Index of a face of element.
global_treeid – [in] Global index of the tree that contains element.
dual_face – [out] Return value, the dual_face index of the face neighbor.
- Returns:
The index of the face neighbor leaf (local element or ghost).