From: Daniel Arndt Date: Mon, 10 Dec 2018 22:38:54 +0000 (+0100) Subject: Avoid MSVC ICE X-Git-Tag: v9.1.0-rc1~497^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0d53215d3ce07d49e4d2086c813f4e34d0ce62e6;p=dealii.git Avoid MSVC ICE --- 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 --------------------------- */