]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Used GeometryInfo::unit_normal_vector in mapping_cartesian.cc
authorReza Rastak <rastak@stanford.edu>
Wed, 4 Sep 2019 19:41:49 +0000 (12:41 -0700)
committerReza Rastak <rastak@stanford.edu>
Wed, 4 Sep 2019 19:42:20 +0000 (12:42 -0700)
source/fe/mapping_cartesian.cc

index d809a20c67037d2d68649fd9acac85ac125cc14a..f9f87a5de675e86d2ab12643b6d75ea6c655635e 100644 (file)
@@ -289,50 +289,9 @@ MappingCartesian<dim, spacedim>::compute_fill(
   if (update_flags & update_normal_vectors)
     {
       Assert(face_no < GeometryInfo<dim>::faces_per_cell, ExcInternalError());
-
-      switch (dim)
-        {
-          case 1:
-            {
-              static const Point<dim> normals[GeometryInfo<1>::faces_per_cell] =
-                {Point<dim>(-1.), Point<dim>(1.)};
-              std::fill(normal_vectors.begin(),
-                        normal_vectors.end(),
-                        normals[face_no]);
-              break;
-            }
-
-          case 2:
-            {
-              static const Point<dim> normals[GeometryInfo<2>::faces_per_cell] =
-                {Point<dim>(-1, 0),
-                 Point<dim>(1, 0),
-                 Point<dim>(0, -1),
-                 Point<dim>(0, 1)};
-              std::fill(normal_vectors.begin(),
-                        normal_vectors.end(),
-                        normals[face_no]);
-              break;
-            }
-
-          case 3:
-            {
-              static const Point<dim> normals[GeometryInfo<3>::faces_per_cell] =
-                {Point<dim>(-1, 0, 0),
-                 Point<dim>(1, 0, 0),
-                 Point<dim>(0, -1, 0),
-                 Point<dim>(0, 1, 0),
-                 Point<dim>(0, 0, -1),
-                 Point<dim>(0, 0, 1)};
-              std::fill(normal_vectors.begin(),
-                        normal_vectors.end(),
-                        normals[face_no]);
-              break;
-            }
-
-          default:
-            Assert(false, ExcNotImplemented());
-        }
+      std::fill(normal_vectors.begin(),
+                normal_vectors.end(),
+                Point<dim>{GeometryInfo<dim>::unit_normal_vector[face_no]});
     }
 }
 

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.