]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Bugfix: Fix GeometryInfo<2>::child_cell_on_face to respect face_flip
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 1 Dec 2012 17:16:18 +0000 (17:16 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 1 Dec 2012 17:16:18 +0000 (17:16 +0000)
This change does not trigger any regression in the test suite

git-svn-id: https://svn.dealii.org/trunk@27714 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/base/geometry_info.h
deal.II/source/base/geometry_info.cc

index fe77dda1b572bfe1088862d116ff99d74498c7ef..1862b363ede9949a3e0d09a35f2034de66c5e6b1 100644 (file)
@@ -1200,8 +1200,8 @@ struct GeometryInfo<0>
  * normal vector is pointing the other direction. There are not very many
  * places in application programs where you need this information actually,
  * but a few places in the library make use of this. Note that in 2d, the
- * result is always @p true. More information on the topic can be found in the
- * @ref GlossFaceOrientation "glossary" article on this topic.
+ * result is always @p true. More information on the topic can be found in this
+ * @ref GlossFaceOrientation "glossary" article.
  *
  * In order to allow all kinds of meshes in 3d, including
  * <em>Moebius</em>-loops, for example, a face might even be rotated looking
@@ -1792,8 +1792,10 @@ struct GeometryInfo
    * <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.
+   * <tt>false</tt> (standard orientation).
+   * In 2d only <tt>face_flip</tt> is considered.
+   * See this @ref GlossFaceOrientation "glossary"
+   * article for more information.
    *
    * As the children of a cell are
    * ordered according to the
index 833981f70de22ec0ce6b45fa0c585162987260da..60c190ee1e5f4936cc42fe4f219676a92bef3114 100644 (file)
@@ -1099,7 +1099,7 @@ unsigned int
 GeometryInfo<2>::child_cell_on_face (const RefinementCase<2> &ref_case,
                                      const unsigned int face,
                                      const unsigned int subface,
-                                     const bool, const bool, const bool,
+                                     const bool, const bool face_flip, const bool,
                                      const RefinementCase<1> &)
 {
   Assert (face<faces_per_cell, ExcIndexRange(face, 0, faces_per_cell));
@@ -1114,14 +1114,23 @@ GeometryInfo<2>::child_cell_on_face (const RefinementCase<2> &ref_case,
   // refined neighbor. this simplifies setting neighbor
   // information in execute_refinement.
   static const unsigned int
-  subcells[RefinementCase<2>::isotropic_refinement][faces_per_cell][max_children_per_face] =
+  subcells[2][RefinementCase<2>::isotropic_refinement][faces_per_cell][max_children_per_face] =
   {
-    {{0,0},{1,1},{0,1},{0,1}},          // cut_x
-    {{0,1},{0,1},{0,0},{1,1}},          // cut_y
-    {{0,2},{1,3},{0,1},{2,3}}
-  };         // cut_xy
+    {
+      // Normal orientation (face_filp = false)
+      {{0,0},{1,1},{0,1},{0,1}},          // cut_x
+      {{0,1},{0,1},{0,0},{1,1}},          // cut_y
+      {{0,2},{1,3},{0,1},{2,3}}           // cut_z
+    },
+    {
+      // Flipped orientation (face_flip = true)
+      {{0,0},{1,1},{1,0},{1,0}},          // cut_x
+      {{1,0},{1,0},{0,0},{1,1}},          // cut_y
+      {{2,0},{3,1},{1,0},{3,2}}           // cut_z
+    }
+  };
 
-  return subcells[ref_case-1][face][subface];
+  return subcells[face_flip][ref_case-1][face][subface];
 }
 
 

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.