From 1fe40986f4db6f40813617265ec07fdb4b262cb1 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Mon, 18 Oct 2021 21:33:31 -0600 Subject: [PATCH] Replace uses of GeometryInfo. --- include/deal.II/grid/reference_cell.h | 40 +++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/include/deal.II/grid/reference_cell.h b/include/deal.II/grid/reference_cell.h index 025abf9e67..82eb82a7da 100644 --- a/include/deal.II/grid/reference_cell.h +++ b/include/deal.II/grid/reference_cell.h @@ -869,9 +869,45 @@ ReferenceCell::vertex(const unsigned int v) const AssertDimension(dim, get_dimension()); AssertIndexRange(v, n_vertices()); - if (*this == ReferenceCells::get_hypercube()) + if ((dim == 0) && (*this == ReferenceCells::Vertex)) + { + return Point(0); + } + else if ((dim == 1) && (*this == ReferenceCells::Line)) + { + static const Point vertices[2] = { + Point(), // the origin + Point::unit_vector(0) // unit point along x-axis + }; + return vertices[v]; + } + else if ((dim == 2) && (*this == ReferenceCells::Quadrilateral)) { - return GeometryInfo::unit_cell_vertex(v); + static const Point vertices[4] = { + // First the two points on the x-axis + Point(), + Point::unit_vector(0), + // Then these two points shifted in the y-direction + Point() + Point::unit_vector(1), + Point::unit_vector(0) + Point::unit_vector(1)}; + return vertices[v]; + } + else if ((dim == 3) && (*this == ReferenceCells::Hexahedron)) + { + static const Point vertices[8] = { + // First the two points on the x-axis + Point(), + Point::unit_vector(0), + // Then these two points shifted in the y-direction + Point() + Point::unit_vector(1), + Point::unit_vector(0) + Point::unit_vector(1), + // And now all four points shifted in the z-direction + Point() + Point::unit_vector(2), + Point::unit_vector(0) + Point::unit_vector(2), + Point() + Point::unit_vector(1) + Point::unit_vector(2), + Point::unit_vector(0) + Point::unit_vector(1) + + Point::unit_vector(2)}; + return vertices[v]; } else if ((dim == 2) && (*this == ReferenceCells::Triangle)) { -- 2.39.5