]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Can't use ReferenceCells in switch-case. 14010/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Sat, 18 Jun 2022 01:33:59 +0000 (10:33 +0900)
committerWolfgang Bangerth <bangerth@colostate.edu>
Sat, 18 Jun 2022 01:33:59 +0000 (10:33 +0900)
tests/simplex/poisson_01.cc

index 6392a7b4b6702b0981541b029cb7953d8a05edf1..e7bffa733eb80abe0cffbceb4fc59e1a4a8abe0e 100644 (file)
@@ -257,35 +257,38 @@ test(const Triangulation<dim, spacedim> &tria,
   Assert(reference_cells.size() == 1, ExcNotImplemented());
   unsigned int lower = 0;
   unsigned int upper = 0;
-  switch (reference_cells[0])
+  if (reference_cells[0] == ReferenceCells::Triangle)
     {
-      case ReferenceCells::Triangle:
-        lower = 111;
-        upper = 115;
-        break;
-      case ReferenceCells::Quadrilateral:
-        lower = 96;
-        upper = 100;
-        break;
-      case ReferenceCells::Tetrahedron:
-        lower = 154;
-        upper = 158;
-        break;
-      case ReferenceCells::Hexahedron:
-        lower = 132;
-        upper = 136;
-        break;
-      case ReferenceCells::Wedge:
-        lower = 194;
-        upper = 198;
-        break;
-      case ReferenceCells::Pyramid:
-        lower = 81;
-        upper = 85;
-        break;
-      default:
-        Assert(false, ExcInternalError());
+      lower = 111;
+      upper = 115;
     }
+  else if (reference_cells[0] == ReferenceCells::Quadrilateral)
+    {
+      lower = 96;
+      upper = 100;
+    }
+  else if (reference_cells[0] == ReferenceCells::Tetrahedron)
+    {
+      lower = 154;
+      upper = 158;
+    }
+  else if (reference_cells[0] == ReferenceCells::Hexahedron)
+    {
+      lower = 132;
+      upper = 136;
+    }
+  else if (reference_cells[0] == ReferenceCells::Wedge)
+    {
+      lower = 194;
+      upper = 198;
+    }
+  else if (reference_cells[0] == ReferenceCells::Pyramid)
+    {
+      lower = 81;
+      upper = 85;
+    }
+  else
+    Assert(false, ExcInternalError());
 
   check_solver_within_range(
     solver.solve(system_matrix, solution, system_rhs, PreconditionIdentity()),

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.