]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add redundant checks in hopes of avoiding a compiler warning. 11617/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Mon, 25 Jan 2021 18:00:03 +0000 (11:00 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Mon, 25 Jan 2021 18:00:03 +0000 (11:00 -0700)
source/grid/reference_cell.cc

index 19a303d0b8ce11db9ae431ce2cf81adda5a36bd0..a3862be05445c5722e3ae9b60dca031859e87dfb 100644 (file)
@@ -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<Point<spacedim>> vertices = {
           Point<spacedim>(),               // 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);
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.