From: Wolfgang Bangerth <bangerth@colostate.edu>
Date: Tue, 19 Oct 2021 15:59:52 +0000 (-0600)
Subject: Systematize construction of vertices for wedges.
X-Git-Tag: v9.4.0-rc1~923^2
X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F12848%2Fhead;p=dealii.git

Systematize construction of vertices for wedges.
---

diff --git a/include/deal.II/grid/reference_cell.h b/include/deal.II/grid/reference_cell.h
index 9a8305908d..8d541274e4 100644
--- a/include/deal.II/grid/reference_cell.h
+++ b/include/deal.II/grid/reference_cell.h
@@ -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