]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Implement face_to_cell_vertices for pyramids and wedges. 11121/head
authorDavid Wells <drwells@email.unc.edu>
Fri, 30 Oct 2020 16:51:24 +0000 (12:51 -0400)
committerDavid Wells <drwells@email.unc.edu>
Sat, 31 Oct 2020 14:08:08 +0000 (10:08 -0400)
include/deal.II/grid/reference_cell.h

index 275bf0547c75f72f45837b1555e8f5025897e337..5dca4d22e795ebce16f17630f6e5513075cabdba 100644 (file)
@@ -783,11 +783,38 @@ namespace ReferenceCell
         {
           AssertIndexRange(face_no, n_faces());
 
-          if (face_no == 1)
+          if (face_no == 0)
             return ReferenceCell::Type::Quad;
           else
             return ReferenceCell::Type::Tri;
         }
+
+        unsigned int
+        face_to_cell_vertices(
+          const unsigned int  face,
+          const unsigned int  vertex,
+          const unsigned char face_orientation) const override
+        {
+          AssertIndexRange(face, n_faces());
+          if (face == 0)
+            {
+              AssertIndexRange(vertex, 4);
+            }
+          else
+            {
+              AssertIndexRange(vertex, 3);
+            }
+          constexpr auto X = numbers::invalid_unsigned_int;
+          static const std::array<std::array<unsigned int, 4>, 5> table = {
+            {{{0, 1, 2, 3}},
+             {{0, 2, 4, X}},
+             {{3, 1, 4, X}},
+             {{1, 0, 4, X}},
+             {{2, 3, 4, X}}}};
+
+          return table[face][standard_to_real_face_vertex(
+            vertex, face, face_orientation)];
+        }
       };
 
 
@@ -908,6 +935,33 @@ namespace ReferenceCell
           else
             return ReferenceCell::Type::Tri;
         }
+
+        unsigned int
+        face_to_cell_vertices(
+          const unsigned int  face,
+          const unsigned int  vertex,
+          const unsigned char face_orientation) const override
+        {
+          AssertIndexRange(face, n_faces());
+          if (face < 2)
+            {
+              AssertIndexRange(vertex, 3);
+            }
+          else
+            {
+              AssertIndexRange(vertex, 4);
+            }
+          constexpr auto X = numbers::invalid_unsigned_int;
+          static const std::array<std::array<unsigned int, 4>, 6> table = {
+            {{{1, 0, 2, X}},
+             {{3, 4, 5, X}},
+             {{0, 1, 3, 4}},
+             {{1, 2, 4, 5}},
+             {{2, 0, 5, 3}}}};
+
+          return table[face][standard_to_real_face_vertex(
+            vertex, face, face_orientation)];
+        }
       };
 
 

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.