]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Work on internal::MatrixFreeFunctions::FaceToCellTopology::face_orientation 10810/head
authorPeter Munch <peterrmuench@gmail.com>
Sun, 9 Aug 2020 16:00:56 +0000 (18:00 +0200)
committerPeter Munch <peterrmuench@gmail.com>
Sun, 9 Aug 2020 16:00:56 +0000 (18:00 +0200)
include/deal.II/matrix_free/face_info.h
include/deal.II/matrix_free/fe_evaluation.h

index 2c03927bc54481d9c2db48e631e3515c1316e81e..43d8d820e822f8f2bab3cf0c9430255e0c09d650 100644 (file)
@@ -100,8 +100,13 @@ namespace internal
        * In 3D, one of the two cells adjacent to a face might use a different
        * orientation (also called as face orientation, face flip and face
        * rotation) than the standard orientation. This variable stores the
-       * value (for one of the interior or exterior side) for the present batch
-       * of faces.
+       * values of face orientation, face flip and face
+       * rotation (for one of the interior or exterior side) for the present
+       * batch of faces in the first free bits. The forth bit is one if the
+       * internal cell has non-standard orientation.
+       *
+       * @note In contrast to other place in the library, the face-orientation
+       *   bit (first bit) is flipped.
        */
       unsigned char face_orientation;
 
index b5b172956e10e5c1033c48416737e1b70822b6be..75773881dc951b4bff3fb37e96505c180569ec74 100644 (file)
@@ -7722,22 +7722,19 @@ FEFaceEvaluation<dim,
 
   this->face_no =
     (this->is_interior_face ? faces.interior_face_no : faces.exterior_face_no);
-  this->subface_index = faces.subface_index;
-  if (this->is_interior_face == true)
-    {
-      this->subface_index = GeometryInfo<dim>::max_children_per_cell;
-      if (faces.face_orientation > 8)
-        this->face_orientation = faces.face_orientation - 8;
-      else
-        this->face_orientation = 0;
-    }
-  else
-    {
-      if (faces.face_orientation < 8)
-        this->face_orientation = faces.face_orientation;
-      else
-        this->face_orientation = 0;
-    }
+  this->subface_index = this->is_interior_face == true ?
+                          GeometryInfo<dim>::max_children_per_cell :
+                          faces.subface_index;
+
+  // First check if interior or exterior cell has non-standard orientation
+  // (i.e. the third bit is one or not). Then set zero if this cell has
+  // standard-orientation else copy the first three bits
+  // (which is equivalent to modulo 8). See also the documentation of
+  // internal::MatrixFreeFunctions::FaceToCellTopology::face_orientation.
+  this->face_orientation =
+    (this->is_interior_face == (faces.face_orientation >= 8)) ?
+      (faces.face_orientation % 8) :
+      0;
 
   this->cell_type = this->matrix_info->get_mapping_info().face_type[face_index];
   const unsigned int offsets =

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.