]> https://gitweb.dealii.org/ - dealii.git/commitdiff
ReferenceCell::child_cell_on_face(): make the orientation mandatory.
authorDavid Wells <drwells@email.unc.edu>
Sat, 1 Feb 2025 21:17:10 +0000 (16:17 -0500)
committerDavid Wells <drwells@email.unc.edu>
Sat, 1 Feb 2025 21:30:21 +0000 (16:30 -0500)
include/deal.II/grid/reference_cell.h

index 032bc46af39507c7acf433bc9f3c4a94da670e76..f179143b9eae15e9b77032d8931c5a869bf04199 100644 (file)
@@ -452,6 +452,19 @@ public:
   static constexpr types::geometric_orientation
   reversed_combined_line_orientation();
 
+  /**
+   * Return which child cells are adjacent to a certain face of the
+   * parent cell.
+   *
+   * @deprecated Use the version of this function which takes the orientation as
+   * the third parameter instead.
+   */
+  DEAL_II_DEPRECATED_EARLY_WITH_COMMENT(
+    "Use the version of this function which takes the orientation as the third "
+    "parameter instead.")
+  unsigned int
+  child_cell_on_face(const unsigned int face, const unsigned int subface) const;
+
   /**
    * Return which child cells are adjacent to a certain face of the
    * parent cell.
@@ -496,8 +509,7 @@ public:
   unsigned int
   child_cell_on_face(const unsigned int                 face,
                      const unsigned int                 subface,
-                     const types::geometric_orientation face_orientation =
-                       numbers::default_geometric_orientation) const;
+                     const types::geometric_orientation face_orientation) const;
 
   /**
    * For a given vertex in a cell, return a pair of a face index and a
@@ -2114,6 +2126,17 @@ ReferenceCell::reversed_combined_line_orientation()
 
 
 
+inline unsigned int
+ReferenceCell::child_cell_on_face(const unsigned int face,
+                                  const unsigned int subface) const
+{
+  return child_cell_on_face(face,
+                            subface,
+                            numbers::default_geometric_orientation);
+}
+
+
+
 inline unsigned int
 ReferenceCell::child_cell_on_face(
   const unsigned int                 face,
@@ -2136,7 +2159,15 @@ ReferenceCell::child_cell_on_face(
           static constexpr ndarray<unsigned int, 3, 2> subcells = {
             {{{0, 1}}, {{1, 2}}, {{2, 0}}}};
 
-          return subcells[face][subface];
+          Assert(combined_face_orientation ==
+                     numbers::default_geometric_orientation ||
+                   combined_face_orientation ==
+                     numbers::reverse_line_orientation,
+                 ExcInternalError());
+          return subcells[face][combined_face_orientation ==
+                                    numbers::default_geometric_orientation ?
+                                  subface :
+                                  1 - subface];
         }
       case ReferenceCells::Quadrilateral:
         {

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.