]> https://gitweb.dealii.org/ - dealii.git/commitdiff
TriaAccessor: use face_orientation() in 2d.
authorDavid Wells <drwells@email.unc.edu>
Sat, 18 Jan 2025 17:24:17 +0000 (12:24 -0500)
committerDavid Wells <drwells@email.unc.edu>
Wed, 22 Jan 2025 18:25:54 +0000 (13:25 -0500)
We shouldn't use the lower-level functions unless we specifically need to.

source/grid/tria_accessor.cc

index 10b706482edb732e0da5ed29b0f9f79912bad24d..0ea23285710f2403168462bc153ad0bd78001121 100644 (file)
@@ -3044,21 +3044,19 @@ CellAccessor<dim, spacedim>::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<CellAccessor<dim, spacedim>> sub_neighbor =
                 neighbor_cell->child(neighbor_child_index);
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.