]> https://gitweb.dealii.org/ - dealii.git/commitdiff
MatrixFree: refactor a face setup routine. 18362/head
authorDavid Wells <drwells@email.unc.edu>
Thu, 17 Apr 2025 17:29:44 +0000 (13:29 -0400)
committerDavid Wells <drwells@email.unc.edu>
Thu, 17 Apr 2025 18:11:48 +0000 (14:11 -0400)
include/deal.II/matrix_free/face_setup_internal.h

index 37a8ebc16ce697c3ac99b4412138e1b62a9dd309..6435a938961789ea990fa2a7eee53d1c7ac4a662 100644 (file)
@@ -1071,37 +1071,39 @@ namespace internal
                                     .get_periodic_face_map()
                                     .at({cell, face_no})
                                     .second;
-
-          return info;
-        }
-
-      info.face_orientation = 0;
-      const auto interior_face_orientation =
-        cell->combined_face_orientation(face_no);
-      const auto exterior_face_orientation =
-        neighbor->combined_face_orientation(info.exterior_face_no);
-      if (interior_face_orientation != numbers::default_geometric_orientation)
-        {
-          info.face_orientation = 8 + interior_face_orientation;
-          Assert(
-            exterior_face_orientation == numbers::default_geometric_orientation,
-            ExcMessage("Face seems to be wrongly oriented from both sides"));
         }
       else
-        info.face_orientation = exterior_face_orientation;
-
-      // make sure to select correct subface index in case of non-standard
-      // orientation of the coarser neighbor face
-      if (cell->level() > neighbor->level() && exterior_face_orientation > 0)
         {
-          const Table<2, unsigned int> orientation =
-            ShapeInfo<double>::compute_orientation_table(2);
-          const auto face_reference_cell =
-            cell->face(face_no)->reference_cell();
-          info.subface_index =
-            orientation(face_reference_cell.get_inverse_combined_orientation(
-                          exterior_face_orientation),
-                        info.subface_index);
+          const auto interior_face_orientation =
+            cell->combined_face_orientation(face_no);
+          const auto exterior_face_orientation =
+            neighbor->combined_face_orientation(info.exterior_face_no);
+          if (interior_face_orientation !=
+              numbers::default_geometric_orientation)
+            {
+              info.face_orientation = 8 + interior_face_orientation;
+              Assert(exterior_face_orientation ==
+                       numbers::default_geometric_orientation,
+                     ExcMessage(
+                       "Face seems to be wrongly oriented from both sides"));
+            }
+          else
+            info.face_orientation = exterior_face_orientation;
+
+          // make sure to select correct subface index in case of non-standard
+          // orientation of the coarser neighbor face
+          if (cell->level() > neighbor->level() &&
+              exterior_face_orientation > 0)
+            {
+              const Table<2, unsigned int> orientation =
+                ShapeInfo<double>::compute_orientation_table(2);
+              const auto face_reference_cell =
+                cell->face(face_no)->reference_cell();
+              info.subface_index = orientation(
+                face_reference_cell.get_inverse_combined_orientation(
+                  exterior_face_orientation),
+                info.subface_index);
+            }
         }
 
       return info;

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.