]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Avoid MSVC ICE
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Mon, 10 Dec 2018 22:38:54 +0000 (23:38 +0100)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Mon, 10 Dec 2018 22:38:54 +0000 (23:38 +0100)
source/fe/mapping.cc

index 7222e6d7066b06cf446edfb60dc1734f1e35b6ff..60d57958000e9a02ad8d0abfa33e4ca2d759a2a4 100644 (file)
@@ -35,6 +35,7 @@ Mapping<dim, spacedim>::get_vertices(
 }
 
 
+
 template <int dim, int spacedim>
 Point<dim - 1>
 Mapping<dim, spacedim>::project_real_point_to_unit_point_on_face(
@@ -49,26 +50,29 @@ Mapping<dim, spacedim>::project_real_point_to_unit_point_on_face(
 
   Point<dim> unit_cell_pt = transform_real_to_unit_cell(cell, p);
 
-  Point<dim - 1> unit_face_pt;
+  const unsigned int unit_normal_direction =
+    GeometryInfo<dim>::unit_normal_direction[face_no];
 
   if (dim == 2)
     {
-      if (GeometryInfo<dim>::unit_normal_direction[face_no] == 0)
-        unit_face_pt = Point<dim - 1>(unit_cell_pt(1));
-      else if (GeometryInfo<dim>::unit_normal_direction[face_no] == 1)
-        unit_face_pt = Point<dim - 1>(unit_cell_pt(0));
+      if (unit_normal_direction == 0)
+        return Point<dim - 1>{unit_cell_pt(1)};
+      else if (unit_normal_direction == 1)
+        return Point<dim - 1>{unit_cell_pt(0)};
     }
   else if (dim == 3)
     {
-      if (GeometryInfo<dim>::unit_normal_direction[face_no] == 0)
-        unit_face_pt = Point<dim - 1>(unit_cell_pt(1), unit_cell_pt(2));
-      else if (GeometryInfo<dim>::unit_normal_direction[face_no] == 1)
-        unit_face_pt = Point<dim - 1>(unit_cell_pt(0), unit_cell_pt(2));
-      else if (GeometryInfo<dim>::unit_normal_direction[face_no] == 2)
-        unit_face_pt = Point<dim - 1>(unit_cell_pt(0), unit_cell_pt(1));
+      if (unit_normal_direction == 0)
+        return Point<dim - 1>{unit_cell_pt(1), unit_cell_pt(2)};
+      else if (unit_normal_direction == 1)
+        return Point<dim - 1>{unit_cell_pt(0), unit_cell_pt(2)};
+      else if (unit_normal_direction == 2)
+        return Point<dim - 1>{unit_cell_pt(0), unit_cell_pt(1)};
     }
 
-  return unit_face_pt;
+  // We should never get here
+  Assert(false, ExcInternalError());
+  return {};
 }
 
 /* ---------------------------- InternalDataBase --------------------------- */

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.