]> https://gitweb.dealii.org/ - dealii.git/commitdiff
MatrixFree: remove some hardcoded inverses. 18346/head
authorDavid Wells <drwells@email.unc.edu>
Thu, 10 Apr 2025 02:07:39 +0000 (22:07 -0400)
committerDavid Wells <drwells@email.unc.edu>
Fri, 11 Apr 2025 14:59:08 +0000 (10:59 -0400)
include/deal.II/matrix_free/face_setup_internal.h
include/deal.II/matrix_free/fe_evaluation.h

index 4121592efdcac08cc9098abcc7925600b9b1db3c..94125511950c2170369a8bd2c91f3bba66a4b052 100644 (file)
@@ -1106,11 +1106,12 @@ namespace internal
         {
           const Table<2, unsigned int> orientation =
             ShapeInfo<double>::compute_orientation_table(2);
-          const std::array<unsigned int, 8> inverted_orientations{
-            {0, 1, 6, 3, 4, 5, 2, 7}};
+          const auto face_reference_cell =
+            cell->face(face_no)->reference_cell();
           info.subface_index =
-            orientation[inverted_orientations[exterior_face_orientation]]
-                       [info.subface_index];
+            orientation(face_reference_cell.get_inverse_combined_orientation(
+                          exterior_face_orientation),
+                        info.subface_index);
         }
 
       return info;
index d819941a541ffd84fc39f7d01368d0dce03630fe..a481c9f6b8d9bab5fe86e713a2cec62a4470a0c8 100644 (file)
@@ -7511,13 +7511,17 @@ FEFaceEvaluation<dim,
               this->face_numbers[i] = faces.exterior_face_no;
             }
 
-          const bool   orientation_interior_face = faces.face_orientation >= 8;
-          unsigned int face_orientation          = faces.face_orientation % 8;
+          const bool orientation_interior_face = faces.face_orientation >= 8;
+          auto       face_orientation          = faces.face_orientation % 8;
           if (face_identifies_as_interior != orientation_interior_face)
             {
-              constexpr std::array<std::uint8_t, 8> table{
-                {0, 1, 6, 3, 4, 5, 2, 7}};
-              face_orientation = table[face_orientation];
+              Assert(this->matrix_free->get_cell_iterator(cell_index, i)
+                         ->reference_cell() ==
+                       ReferenceCells::get_hypercube<dim>(),
+                     ExcNotImplemented());
+              face_orientation =
+                ReferenceCells::get_hypercube<dim - 1>()
+                  .get_inverse_combined_orientation(face_orientation);
             }
           this->face_orientations[i] = face_orientation;
         }

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.