From: Wolfgang Bangerth Date: Wed, 13 May 2020 21:23:00 +0000 (-0600) Subject: Make the logic in step-50's main() function simpler. X-Git-Tag: v9.3.0-rc1~1634^2~12 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=63c355f4c01986978f145864900ac17852e0e8af;p=dealii.git Make the logic in step-50's main() function simpler. --- diff --git a/examples/step-50/step-50.cc b/examples/step-50/step-50.cc index 4f031dfa35..7e92b77d7d 100644 --- a/examples/step-50/step-50.cc +++ b/examples/step-50/step-50.cc @@ -1488,15 +1488,28 @@ int main(int argc, char *argv[]) try { - if (settings.dimension == 2) - { - LaplaceProblem<2, 2> test(settings); - test.run(); - } - else if (settings.dimension == 3) + constexpr unsigned int fe_degree = 2; + + switch (settings.dimension) { - LaplaceProblem<3, 2> test(settings); - test.run(); + case 2: + { + LaplaceProblem<2, fe_degree> test(settings); + test.run(); + + break; + } + + case 3: + { + LaplaceProblem<3, fe_degree> test(settings); + test.run(); + + break; + } + + default: + Assert(false, ExcMessage("This program only works in 2d and 3d.")); } } catch (std::exception &exc)