From: Wolfgang Bangerth Date: Thu, 14 Jan 2021 17:55:37 +0000 (-0700) Subject: Make code slightly easier to read. X-Git-Tag: v9.3.0-rc1~621^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F11543%2Fhead;p=dealii.git Make code slightly easier to read. --- diff --git a/source/simplex/fe_lib.cc b/source/simplex/fe_lib.cc index 78bfcdd0f0..d0c7ac1cc3 100644 --- a/source/simplex/fe_lib.cc +++ b/source/simplex/fe_lib.cc @@ -69,60 +69,52 @@ namespace Simplex { // We don't really have dim = 1 support for simplex elements yet, but // its convenient for populating the face array + Assert(degree <= 2, ExcNotImplemented()); if (degree >= 1) { unit_points.emplace_back(0.0); unit_points.emplace_back(1.0); - } - if (degree == 2) - { - unit_points.emplace_back(0.5); - } - if (degree > 2) - { - Assert(false, ExcNotImplemented()); + + if (degree == 2) + unit_points.emplace_back(0.5); } } else if (dim == 2) { + Assert(degree <= 2, ExcNotImplemented()); if (degree >= 1) { unit_points.emplace_back(0.0, 0.0); unit_points.emplace_back(1.0, 0.0); unit_points.emplace_back(0.0, 1.0); - } - if (degree == 2) - { - unit_points.emplace_back(0.5, 0.0); - unit_points.emplace_back(0.5, 0.5); - unit_points.emplace_back(0.0, 0.5); - } - if (degree > 3) - { - Assert(false, ExcNotImplemented()); + + if (degree == 2) + { + unit_points.emplace_back(0.5, 0.0); + unit_points.emplace_back(0.5, 0.5); + unit_points.emplace_back(0.0, 0.5); + } } } else if (dim == 3) { + Assert(degree <= 2, ExcNotImplemented()); if (degree >= 1) { unit_points.emplace_back(0.0, 0.0, 0.0); unit_points.emplace_back(1.0, 0.0, 0.0); unit_points.emplace_back(0.0, 1.0, 0.0); unit_points.emplace_back(0.0, 0.0, 1.0); - } - if (degree == 2) - { - unit_points.emplace_back(0.5, 0.0, 0.0); - unit_points.emplace_back(0.5, 0.5, 0.0); - unit_points.emplace_back(0.0, 0.5, 0.0); - unit_points.emplace_back(0.0, 0.0, 0.5); - unit_points.emplace_back(0.5, 0.0, 0.5); - unit_points.emplace_back(0.0, 0.5, 0.5); - } - if (degree == 3) - { - Assert(false, ExcNotImplemented()); + + if (degree == 2) + { + unit_points.emplace_back(0.5, 0.0, 0.0); + unit_points.emplace_back(0.5, 0.5, 0.0); + unit_points.emplace_back(0.0, 0.5, 0.0); + unit_points.emplace_back(0.0, 0.0, 0.5); + unit_points.emplace_back(0.5, 0.0, 0.5); + unit_points.emplace_back(0.0, 0.5, 0.5); + } } } else