From 48cc018fbf6585d0998b9a07c87ca7a70578e371 Mon Sep 17 00:00:00 2001 From: Reza Rastak Date: Wed, 4 Sep 2019 12:41:49 -0700 Subject: [PATCH] Used GeometryInfo::unit_normal_vector in mapping_cartesian.cc --- source/fe/mapping_cartesian.cc | 47 +++------------------------------- 1 file changed, 3 insertions(+), 44 deletions(-) diff --git a/source/fe/mapping_cartesian.cc b/source/fe/mapping_cartesian.cc index d809a20c67..f9f87a5de6 100644 --- a/source/fe/mapping_cartesian.cc +++ b/source/fe/mapping_cartesian.cc @@ -289,50 +289,9 @@ MappingCartesian::compute_fill( if (update_flags & update_normal_vectors) { Assert(face_no < GeometryInfo::faces_per_cell, ExcInternalError()); - - switch (dim) - { - case 1: - { - static const Point normals[GeometryInfo<1>::faces_per_cell] = - {Point(-1.), Point(1.)}; - std::fill(normal_vectors.begin(), - normal_vectors.end(), - normals[face_no]); - break; - } - - case 2: - { - static const Point normals[GeometryInfo<2>::faces_per_cell] = - {Point(-1, 0), - Point(1, 0), - Point(0, -1), - Point(0, 1)}; - std::fill(normal_vectors.begin(), - normal_vectors.end(), - normals[face_no]); - break; - } - - case 3: - { - static const Point normals[GeometryInfo<3>::faces_per_cell] = - {Point(-1, 0, 0), - Point(1, 0, 0), - Point(0, -1, 0), - Point(0, 1, 0), - Point(0, 0, -1), - Point(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{GeometryInfo::unit_normal_vector[face_no]}); } } -- 2.39.5