]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Systematize construction of vertices for wedges. 12848/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Tue, 19 Oct 2021 15:59:52 +0000 (09:59 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Tue, 19 Oct 2021 15:59:52 +0000 (09:59 -0600)
include/deal.II/grid/reference_cell.h

index 9a8305908d71b791c5dcfdb47a973f33e0d05a97..8d541274e4d5ce20c556d58342e11f046eb8b1cd 100644 (file)
@@ -903,12 +903,15 @@ ReferenceCell::vertex(const unsigned int v) const
     }
   else if ((dim == 3) && (*this == ReferenceCells::Wedge))
     {
-      static const Point<dim> vertices[6] = {Point<dim>{0.0, 0.0, 0.0},
-                                             Point<dim>{1.0, 0.0, 0.0},
-                                             Point<dim>{0.0, 1.0, 0.0},
-                                             Point<dim>{0.0, 0.0, 1.0},
-                                             Point<dim>{1.0, 0.0, 1.0},
-                                             Point<dim>{0.0, 1.0, 1.0}};
+      static const Point<dim> vertices[6] = {
+        // First the three points on the triangular base of the wedge:
+        Point<dim>(),
+        Point<dim>::unit_vector(0),
+        Point<dim>::unit_vector(1),
+        // And now everything shifted in the z-direction again
+        Point<dim>() + Point<dim>::unit_vector(2),
+        Point<dim>::unit_vector(0) + Point<dim>::unit_vector(2),
+        Point<dim>::unit_vector(1) + Point<dim>::unit_vector(2)};
       return vertices[v];
     }
   else

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.