From: Wolfgang Bangerth Date: Mon, 25 Jan 2021 18:00:03 +0000 (-0700) Subject: Add redundant checks in hopes of avoiding a compiler warning. X-Git-Tag: v9.3.0-rc1~563^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F11617%2Fhead;p=dealii.git Add redundant checks in hopes of avoiding a compiler warning. --- 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);