From: Wolfgang Bangerth Date: Tue, 19 Oct 2021 03:33:31 +0000 (-0600) Subject: Replace uses of GeometryInfo. X-Git-Tag: v9.4.0-rc1~924^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1fe40986f4db6f40813617265ec07fdb4b262cb1;p=dealii.git Replace uses of GeometryInfo. --- 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)) {