]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Guard code for cases of other dimensions. 2426/head
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 28 Mar 2016 14:20:55 +0000 (09:20 -0500)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 28 Mar 2016 14:20:55 +0000 (09:20 -0500)
The current code only tests for dim=2 and dim=3. Make sure we have an
else-branch.

source/fe/mapping_q_generic.cc

index f8452f9d97c364640b37e2534785e450916220d3..3e29849b874ded5ce6e0394eb1d21807de0f0273 100644 (file)
@@ -1,6 +1,6 @@
 // ---------------------------------------------------------------------
 //
-// Copyright (C) 2000 - 2015 by the deal.II authors
+// Copyright (C) 2000 - 2016 by the deal.II authors
 //
 // This file is part of the deal.II library.
 //
@@ -769,7 +769,9 @@ initialize_face (const UpdateFlags      update_flags,
           const unsigned int nfaces = GeometryInfo<dim>::faces_per_cell;
           unit_tangentials.resize (nfaces*(dim-1),
                                    std::vector<Tensor<1,dim> > (n_original_q_points));
-          if (dim==2)
+          switch (dim)
+            {
+            case 2:
             {
               // ensure a counterclockwise
               // orientation of tangentials
@@ -781,8 +783,11 @@ initialize_face (const UpdateFlags      update_flags,
                   std::fill (unit_tangentials[i].begin(),
                              unit_tangentials[i].end(), tang);
                 }
+
+              break;
             }
-          else if (dim==3)
+
+            case 3:
             {
               for (unsigned int i=0; i<nfaces; ++i)
                 {
@@ -810,6 +815,12 @@ initialize_face (const UpdateFlags      update_flags,
                   std::fill (unit_tangentials[nfaces+i].begin(),
                              unit_tangentials[nfaces+i].end(), tang2);
                 }
+
+              break;
+            }
+
+            default:
+              Assert (false, ExcNotImplemented());
             }
         }
     }

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.