]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Make code slightly easier to read. 11543/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Thu, 14 Jan 2021 17:55:37 +0000 (10:55 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Thu, 14 Jan 2021 17:55:37 +0000 (10:55 -0700)
source/simplex/fe_lib.cc

index 78bfcdd0f0f1614ea259cbb8a1e76753401a36d5..d0c7ac1cc30bd78002d0390f8aad1dfc60c2d0c6 100644 (file)
@@ -69,60 +69,52 @@ namespace Simplex
         {
           // We don't really have dim = 1 support for simplex elements yet, but
           // its convenient for populating the face array
+          Assert(degree <= 2, ExcNotImplemented());
           if (degree >= 1)
             {
               unit_points.emplace_back(0.0);
               unit_points.emplace_back(1.0);
-            }
-          if (degree == 2)
-            {
-              unit_points.emplace_back(0.5);
-            }
-          if (degree > 2)
-            {
-              Assert(false, ExcNotImplemented());
+
+              if (degree == 2)
+                unit_points.emplace_back(0.5);
             }
         }
       else if (dim == 2)
         {
+          Assert(degree <= 2, ExcNotImplemented());
           if (degree >= 1)
             {
               unit_points.emplace_back(0.0, 0.0);
               unit_points.emplace_back(1.0, 0.0);
               unit_points.emplace_back(0.0, 1.0);
-            }
-          if (degree == 2)
-            {
-              unit_points.emplace_back(0.5, 0.0);
-              unit_points.emplace_back(0.5, 0.5);
-              unit_points.emplace_back(0.0, 0.5);
-            }
-          if (degree > 3)
-            {
-              Assert(false, ExcNotImplemented());
+
+              if (degree == 2)
+                {
+                  unit_points.emplace_back(0.5, 0.0);
+                  unit_points.emplace_back(0.5, 0.5);
+                  unit_points.emplace_back(0.0, 0.5);
+                }
             }
         }
       else if (dim == 3)
         {
+          Assert(degree <= 2, ExcNotImplemented());
           if (degree >= 1)
             {
               unit_points.emplace_back(0.0, 0.0, 0.0);
               unit_points.emplace_back(1.0, 0.0, 0.0);
               unit_points.emplace_back(0.0, 1.0, 0.0);
               unit_points.emplace_back(0.0, 0.0, 1.0);
-            }
-          if (degree == 2)
-            {
-              unit_points.emplace_back(0.5, 0.0, 0.0);
-              unit_points.emplace_back(0.5, 0.5, 0.0);
-              unit_points.emplace_back(0.0, 0.5, 0.0);
-              unit_points.emplace_back(0.0, 0.0, 0.5);
-              unit_points.emplace_back(0.5, 0.0, 0.5);
-              unit_points.emplace_back(0.0, 0.5, 0.5);
-            }
-          if (degree == 3)
-            {
-              Assert(false, ExcNotImplemented());
+
+              if (degree == 2)
+                {
+                  unit_points.emplace_back(0.5, 0.0, 0.0);
+                  unit_points.emplace_back(0.5, 0.5, 0.0);
+                  unit_points.emplace_back(0.0, 0.5, 0.0);
+                  unit_points.emplace_back(0.0, 0.0, 0.5);
+                  unit_points.emplace_back(0.5, 0.0, 0.5);
+                  unit_points.emplace_back(0.0, 0.5, 0.5);
+                }
             }
         }
       else

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.