From 824d5900357e08ec0c58dc7d35bcb4b32398af7b Mon Sep 17 00:00:00 2001 From: David Wells Date: Sat, 18 Jan 2025 12:24:17 -0500 Subject: [PATCH] TriaAccessor: use face_orientation() in 2d. We shouldn't use the lower-level functions unless we specifically need to. --- source/grid/tria_accessor.cc | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/source/grid/tria_accessor.cc b/source/grid/tria_accessor.cc index 10b706482e..0ea2328571 100644 --- a/source/grid/tria_accessor.cc +++ b/source/grid/tria_accessor.cc @@ -3044,21 +3044,19 @@ CellAccessor::neighbor_child_on_subface( // determine indices for this cell's subface from the perspective // of the neighboring cell - const unsigned int neighbor_face = - this->neighbor_of_neighbor(face); + const auto neighbor_face_no = this->neighbor_of_neighbor(face); + // two neighboring cells have an opposed orientation on their // shared face if both of them follow the same orientation type - // (i.e., standard or non-standard). - // we verify this with a XOR operation. - const unsigned int neighbor_subface = - (!(this->line_orientation(face)) != - !(neighbor_cell->line_orientation(neighbor_face))) ? - (1 - subface) : - subface; + const unsigned int neighbor_subface_no = + this->face_orientation(face) == + neighbor_cell->face_orientation(neighbor_face_no) ? + subface : + 1 - subface; const unsigned int neighbor_child_index = neighbor_cell->reference_cell().child_cell_on_face( - neighbor_face, neighbor_subface); + neighbor_face_no, neighbor_subface_no); const TriaIterator> sub_neighbor = neighbor_cell->child(neighbor_child_index); -- 2.39.5