From 4004fa5395e318970139c4ae949e68eb4e5dab22 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Thu, 21 Jan 2021 20:46:53 -0700 Subject: [PATCH] Simplify code. --- source/grid/reference_cell.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/source/grid/reference_cell.cc b/source/grid/reference_cell.cc index b4db7849e1..a5caf7fd59 100644 --- a/source/grid/reference_cell.cc +++ b/source/grid/reference_cell.cc @@ -96,6 +96,8 @@ namespace ReferenceCell void Type::make_triangulation(Triangulation &tria) const { + AssertDimension(dim, this->get_dimension()); + if (this->is_hyper_cube()) { GridGenerator::hyper_cube(tria, 0, 1); @@ -172,9 +174,9 @@ namespace ReferenceCell { AssertDimension(dim, get_dimension()); - if (*this == Type::get_hypercube()) + if (is_hyper_cube()) return std::make_unique>(degree); - else if (*this == Type::Tri || *this == Type::Tet) + else if (is_simplex()) return std::make_unique>( Simplex::FE_P(degree)); else if (*this == Type::Pyramid) @@ -199,11 +201,11 @@ namespace ReferenceCell { AssertDimension(dim, get_dimension()); - if (*this == Type::get_hypercube()) + if (is_hyper_cube()) { return StaticMappingQ1::mapping; } - else if (*this == Type::Tri || *this == Type::Tet) + else if (is_simplex()) { static const MappingFE mapping( Simplex::FE_P(1)); -- 2.39.5