From 0d53215d3ce07d49e4d2086c813f4e34d0ce62e6 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Mon, 10 Dec 2018 23:38:54 +0100 Subject: [PATCH] Avoid MSVC ICE --- source/fe/mapping.cc | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/source/fe/mapping.cc b/source/fe/mapping.cc index 7222e6d706..60d5795800 100644 --- a/source/fe/mapping.cc +++ b/source/fe/mapping.cc @@ -35,6 +35,7 @@ Mapping::get_vertices( } + template Point Mapping::project_real_point_to_unit_point_on_face( @@ -49,26 +50,29 @@ Mapping::project_real_point_to_unit_point_on_face( Point unit_cell_pt = transform_real_to_unit_cell(cell, p); - Point unit_face_pt; + const unsigned int unit_normal_direction = + GeometryInfo::unit_normal_direction[face_no]; if (dim == 2) { - if (GeometryInfo::unit_normal_direction[face_no] == 0) - unit_face_pt = Point(unit_cell_pt(1)); - else if (GeometryInfo::unit_normal_direction[face_no] == 1) - unit_face_pt = Point(unit_cell_pt(0)); + if (unit_normal_direction == 0) + return Point{unit_cell_pt(1)}; + else if (unit_normal_direction == 1) + return Point{unit_cell_pt(0)}; } else if (dim == 3) { - if (GeometryInfo::unit_normal_direction[face_no] == 0) - unit_face_pt = Point(unit_cell_pt(1), unit_cell_pt(2)); - else if (GeometryInfo::unit_normal_direction[face_no] == 1) - unit_face_pt = Point(unit_cell_pt(0), unit_cell_pt(2)); - else if (GeometryInfo::unit_normal_direction[face_no] == 2) - unit_face_pt = Point(unit_cell_pt(0), unit_cell_pt(1)); + if (unit_normal_direction == 0) + return Point{unit_cell_pt(1), unit_cell_pt(2)}; + else if (unit_normal_direction == 1) + return Point{unit_cell_pt(0), unit_cell_pt(2)}; + else if (unit_normal_direction == 2) + return Point{unit_cell_pt(0), unit_cell_pt(1)}; } - return unit_face_pt; + // We should never get here + Assert(false, ExcInternalError()); + return {}; } /* ---------------------------- InternalDataBase --------------------------- */ -- 2.39.5