From 574409006ab7d5036e1d91683f51afc908a610a5 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Mon, 25 Jan 2021 11:00:03 -0700 Subject: [PATCH] Add redundant checks in hopes of avoiding a compiler warning. --- source/grid/reference_cell.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/grid/reference_cell.cc b/source/grid/reference_cell.cc index 19a303d0b8..a3862be054 100644 --- a/source/grid/reference_cell.cc +++ b/source/grid/reference_cell.cc @@ -73,7 +73,7 @@ namespace ReferenceCell { GridGenerator::hyper_cube(tria, 0, 1); } - else if (reference_cell == Type::Tri) + else if ((dim == 2) && (reference_cell == Type::Tri)) { const std::vector> vertices = { Point(), // the origin @@ -86,7 +86,7 @@ namespace ReferenceCell tria.create_triangulation(vertices, cells, {}); } - else if (reference_cell == Type::Tet) + else if ((dim == 3) && (reference_cell == Type::Tet)) { AssertDimension(spacedim, 3); @@ -98,7 +98,7 @@ namespace ReferenceCell tria.create_triangulation(vertices, cells, {}); } - else if (reference_cell == Type::Pyramid) + else if ((dim == 3) && (reference_cell == Type::Pyramid)) { AssertDimension(spacedim, 3); @@ -114,7 +114,7 @@ namespace ReferenceCell tria.create_triangulation(vertices, cells, {}); } - else if (reference_cell == Type::Wedge) + else if ((dim == 3) && (reference_cell == Type::Wedge)) { AssertDimension(spacedim, 3); -- 2.39.5