]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix another GCC11 warning. 12404/head
authorDavid Wells <drwells@email.unc.edu>
Mon, 7 Jun 2021 18:12:12 +0000 (14:12 -0400)
committerDavid Wells <drwells@email.unc.edu>
Mon, 7 Jun 2021 21:12:56 +0000 (17:12 -0400)
source/fe/fe_simplex_p.cc

index 684ce3c73fa514350a474d01c7b1d913d2d88ed5..ca7851bbc68966833688447e498238175cd5086f 100644 (file)
@@ -35,26 +35,38 @@ namespace
   std::vector<unsigned int>
   get_dpo_vector_fe_p(const unsigned int dim, const unsigned int degree)
   {
-    std::vector<unsigned int> dpo(dim + 1, 0U);
+    Assert(degree == 1 || degree == 2, ExcNotImplemented());
 
-    if (degree == 1)
-      {
-        // one dof at each vertex
-        dpo[0] = 1;
-      }
-    else if (degree == 2)
-      {
-        // one dof at each vertex and in the middle of each line
-        dpo[0] = 1;
-        dpo[1] = 1;
-        dpo[2] = 0;
-      }
-    else
+    switch (dim)
       {
-        Assert(false, ExcNotImplemented());
+        case 1:
+          switch (degree)
+            {
+              case 1:
+                return {1, 0};
+              case 2:
+                return {1, 1};
+            }
+        case 2:
+          switch (degree)
+            {
+              case 1:
+                return {1, 0, 0};
+              case 2:
+                return {1, 1, 0};
+            }
+        case 3:
+          switch (degree)
+            {
+              case 1:
+                return {1, 0, 0, 0};
+              case 2:
+                return {1, 1, 0, 0};
+            }
       }
 
-    return dpo;
+    Assert(false, ExcNotImplemented());
+    return {};
   }
 
   /**

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.