DLR-AMR / t8code

Parallel algorithms and data structures for tree-based adaptive mesh refinement (AMR) with arbitrary element shapes.
https://dlr-amr.github.io/t8code/
GNU General Public License v2.0
134 stars 52 forks source link

Inconsitent edge orientations in t8_eclass.c #975

Open jfussbro opened 6 months ago

jfussbro commented 6 months ago

Currently the lookup table t8_edge_vertex_to_tree_vertex stores the vertices of an edge in a way, that the smaller vertex number is the first and the higher one comes second. In the case of the triangle we therefore get: { { 1, 2 }, { 0, 2 }, { 0, 1 } }, /* triangle */ In order to keep the orientation of the edges in a closed loop, the order should be changed to: { { 1, 2 }, { 2, 0 }, { 0, 1 } }, /* triangle */.

The same also applies for tetrahedral and for prism elements.

lukasdreyer commented 5 months ago

This relates to https://github.com/DLR-AMR/t8code/issues/774 in that there currently is no clearly defined reference element for each shape, that is mapped to the refined element in an orientation preserving way, and whose edge/face/vertex enumeration is used for enumeration of the refined element. The enumeration used for the default scheme enumerates the vertices of the subfaces (here edges) in a lexicographical way. The information regarding reference elements in this file should be collected in a new file and documented, and we should have a discussion, whether to use orientation preserving enumeration or the lexicographical enumeration, that ensures that two neigbouring faces have the same orientation