]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Implement ReferenceCell::face_to_cell_lines() for pyramids and wedges 13692/head
authorPeter Munch <peterrmuench@gmail.com>
Sun, 8 May 2022 14:32:12 +0000 (16:32 +0200)
committerPeter Munch <peterrmuench@gmail.com>
Sun, 8 May 2022 14:32:12 +0000 (16:32 +0200)
include/deal.II/grid/reference_cell.h

index 7e38aa9bc1343b8f44d552b3faa246e47217183b..5431a590922762803efb84ac9daae3a7a5787450 100644 (file)
@@ -1404,6 +1404,8 @@ ReferenceCell::face_to_cell_lines(const unsigned int  face,
   AssertIndexRange(face, n_faces());
   AssertIndexRange(line, face_reference_cell(face).n_lines());
 
+  static constexpr unsigned int X = numbers::invalid_unsigned_int;
+
   if (*this == ReferenceCells::Vertex)
     {
       Assert(false, ExcNotImplemented());
@@ -1440,11 +1442,25 @@ ReferenceCell::face_to_cell_lines(const unsigned int  face,
     }
   else if (*this == ReferenceCells::Pyramid)
     {
-      Assert(false, ExcNotImplemented());
+      static const ndarray<unsigned int, 5, 4> table = {{{{0, 1, 2, 3}},
+                                                         {{0, 6, 4, X}},
+                                                         {{1, 5, 7, X}},
+                                                         {{2, 4, 5, X}},
+                                                         {{3, 7, 6, 2}}}};
+
+      return table[face]
+                  [standard_to_real_face_line(line, face, face_orientation)];
     }
   else if (*this == ReferenceCells::Wedge)
     {
-      Assert(false, ExcNotImplemented());
+      static const ndarray<unsigned int, 5, 4> table = {{{{0, 2, 1, X}},
+                                                         {{3, 4, 5, X}},
+                                                         {{6, 7, 0, 3}},
+                                                         {{7, 8, 1, 4}},
+                                                         {{8, 6, 5, 2}}}};
+
+      return table[face]
+                  [standard_to_real_face_line(line, face, face_orientation)];
     }
   else if (*this == ReferenceCells::Hexahedron)
     {

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.