]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add orientation flags to ReferenceCell::child_cell_on_face().
authorMarc Fehling <mafehling.git@gmail.com>
Fri, 14 May 2021 21:19:57 +0000 (15:19 -0600)
committerMarc Fehling <mafehling.git@gmail.com>
Fri, 14 May 2021 21:30:37 +0000 (15:30 -0600)
include/deal.II/grid/reference_cell.h

index 711fa35937b395995ffac70f0e2ca625fb191252..4aea94003a817e591cc07d815d0064966a5b8826 100644 (file)
@@ -294,24 +294,24 @@ public:
    *
    * For example, in 2D the layout of a quadrilateral cell is as follows:
    * @verbatim
-   *      3
-   *   2-->--3
-   *   |     |
-   * 0 ^     ^ 1
-   *   |     |
-   *   0-->--1
-   *      2
+   *      3
+   *   2-->--3
+   *   |     |
+   * 0 ^     ^ 1
+   *   |     |
+   *   0-->--1
+   *      2
    * @endverbatim
    * Vertices and faces are indicated with their numbers, faces also with
    * their directions.
    *
    * Now, when refined, the layout is like this:
    * @verbatim
-   * *--*--*
-   * | 2|3 |
-   * *--*--*
-   * | 0|1 |
-   * *--*--*
+   * *---*---*
+   * | 2 | 3 |
+   * *---*---*
+   * | 0 | 1 |
+   * *---*---*
    * @endverbatim
    *
    * Thus, the child cells on face 0 are (ordered in the direction of the
@@ -319,10 +319,23 @@ public:
    *
    * For three spatial dimensions, the exact order of the children is laid
    * down in the general documentation of this class.
+   *
+   * The <tt>face_orientation</tt>, <tt>face_flip</tt> and
+   * <tt>face_rotation</tt> arguments are meant exclusively for quadrialaterals
+   * and hexahedra at the moment. They determine how this function handles faces
+   * oriented in the standard and non-standard orientation.
+   * <tt>face_orientation</tt> defaults to <tt>true</tt>, <tt>face_flip</tt> and
+   * <tt>face_rotation</tt> default to <tt>false</tt> (standard orientation) and
+   * has no effect in 2d. The concept of face orientations is explained in this
+   * @ref GlossFaceOrientation "glossary"
+   * entry.
    */
   unsigned int
   child_cell_on_face(const unsigned int face_n,
-                     const unsigned int subface_n) const;
+                     const unsigned int subface_n,
+                     const bool         face_orientation = true,
+                     const bool         face_flip        = false,
+                     const bool         face_rotation    = false) const;
 
   /**
    * For a given vertex in a cell, return a pair of a face index and a
@@ -930,7 +943,10 @@ ReferenceCell::face_reference_cell(const unsigned int face_no) const
 
 inline unsigned int
 ReferenceCell::child_cell_on_face(const unsigned int face,
-                                  const unsigned int subface) const
+                                  const unsigned int subface,
+                                  const bool         face_orientation,
+                                  const bool         face_flip,
+                                  const bool         face_rotation) const
 {
   AssertIndexRange(face, n_faces());
 
@@ -951,7 +967,13 @@ ReferenceCell::child_cell_on_face(const unsigned int face,
     }
   else if (*this == ReferenceCells::Quadrilateral)
     {
-      Assert(false, ExcNotImplemented());
+      return GeometryInfo<2>::child_cell_on_face(
+        RefinementCase<2>(RefinementPossibilities<2>::no_refinement),
+        face,
+        subface,
+        face_orientation,
+        face_flip,
+        face_rotation);
     }
   else if (*this == ReferenceCells::Tetrahedron)
     {
@@ -967,7 +989,13 @@ ReferenceCell::child_cell_on_face(const unsigned int face,
     }
   else if (*this == ReferenceCells::Hexahedron)
     {
-      Assert(false, ExcNotImplemented());
+      return GeometryInfo<3>::child_cell_on_face(
+        RefinementCase<3>(RefinementPossibilities<3>::no_refinement),
+        face,
+        subface,
+        face_orientation,
+        face_flip,
+        face_rotation);
     }
 
   Assert(false, ExcNotImplemented());

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.