From: Luca Heltai Date: Sat, 8 Jul 2023 09:12:38 +0000 (+0200) Subject: Make sure get_fe_by_name works for simplices. X-Git-Tag: relicensing~694^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F15683%2Fhead;p=dealii.git Make sure get_fe_by_name works for simplices. --- diff --git a/doc/news/changes/minor/20230708LucaHeltai b/doc/news/changes/minor/20230708LucaHeltai new file mode 100644 index 0000000000..cc7f975afa --- /dev/null +++ b/doc/news/changes/minor/20230708LucaHeltai @@ -0,0 +1,3 @@ +Fixed: FETools::get_fe_by_name() now works also for simplex finite elements. +
+(Luca Heltai, 2023/07/08) diff --git a/include/deal.II/fe/fe_tools.templates.h b/include/deal.II/fe/fe_tools.templates.h index 0b9b532e5e..4bfc3b9fef 100644 --- a/include/deal.II/fe/fe_tools.templates.h +++ b/include/deal.II/fe/fe_tools.templates.h @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -50,9 +51,12 @@ #include #include #include +#include +#include #include #include #include +#include #include #include @@ -1125,6 +1129,25 @@ namespace FETools std::make_unique>>(); result["FE_RannacherTurek"] = std::make_unique>>(); + // Simplex finite elements + result["FE_SimplexP"] = + std::make_unique>>(); + result["FE_SimplexDGP"] = + std::make_unique>>(); + result["FE_SimplexP_Bubbles"] = + std::make_unique>>(); + // Mixed grids finite elements -- only valid in 3d + if constexpr (dim == 3) + { + result["FE_PyramidP"] = + std::make_unique>>(); + result["FE_PyramidDGP"] = + std::make_unique>>(); + result["FE_WedgeP"] = + std::make_unique>>(); + result["FE_WedgeDGP"] = + std::make_unique>>(); + } } @@ -1161,6 +1184,12 @@ namespace FETools std::make_unique>>(); result["FE_Bernstein"] = std::make_unique>>(); + result["FE_SimplexP"] = + std::make_unique>>(); + result["FE_SimplexDGP"] = + std::make_unique>>(); + result["FE_SimplexP_Bubbles"] = std::make_unique< + FETools::FEFactory>>(); } // The function filling the vector fe_name_map below. It iterates @@ -2517,7 +2546,7 @@ namespace FETools // didn't know what to do with the // string we got. so do as the docs // say: raise an exception - AssertThrow(false, FETools::ExcInvalidFEName(name)); + AssertThrow(false, FETools::ExcInvalidFEName(name_part)); // make some compilers happy that // do not realize that we can't get diff --git a/tests/fe/get_fe_by_name_01.cc b/tests/fe/get_fe_by_name_01.cc index 38a99d72df..8b832c18c7 100644 --- a/tests/fe/get_fe_by_name_01.cc +++ b/tests/fe/get_fe_by_name_01.cc @@ -36,11 +36,11 @@ public: generate(const char *myname) { std::string name = myname; + deallog << "Read " << name << std::endl; std::unique_ptr> fe = FETools::get_fe_by_name(name); - deallog << "Read " << name << std::endl; deallog << "Generated :" << std::endl; deallog << fe->get_name() << std::endl; } @@ -140,6 +140,19 @@ main() gen.generate_all_codim("FE_Bernstein(2)"); gen.generate_all_codim("FE_DGQHermite(3)"); + // Simplex finite elements + gen.generate_all_codim("FE_SimplexP(1)"); + gen.generate_all_codim("FE_SimplexP(2)"); + gen.generate_all_codim("FE_SimplexDGP(1)"); + gen.generate_all_codim("FE_SimplexDGP(2)"); + gen.generate_all_codim("FE_SimplexP_Bubbles(2)"); + + // Mixed grids finite elements + gen.generate<3, 3>("FE_PyramidP(1)"); + gen.generate<3, 3>("FE_PyramidDGP(1)"); + gen.generate<3, 3>("FE_WedgeP(1)"); + gen.generate<3, 3>("FE_WedgeDGP(1)"); + // systems gen.generate_all_dim("FESystem[FE_Q_Hierarchical(1)^2-FE_Q_Hierarchical(1)]"); gen.generate_all_dim( diff --git a/tests/fe/get_fe_by_name_01.output b/tests/fe/get_fe_by_name_01.output index f2249c8265..16931bb955 100644 --- a/tests/fe/get_fe_by_name_01.output +++ b/tests/fe/get_fe_by_name_01.output @@ -554,6 +554,108 @@ DEAL::FE_DGQHermite<2,3>(3) DEAL::Read FE_DGQHermite(3) DEAL::Generated : DEAL::FE_DGQHermite<3>(3) +DEAL::Read FE_SimplexP(1) +DEAL::Generated : +DEAL::FE_SimplexP<1>(1) +DEAL::Read FE_SimplexP(1) +DEAL::Generated : +DEAL::FE_SimplexP<1>(1) +DEAL::Read FE_SimplexP(1) +DEAL::Generated : +DEAL::FE_SimplexP<2>(1) +DEAL::Read FE_SimplexP(1) +DEAL::Generated : +DEAL::FE_SimplexP<1>(1) +DEAL::Read FE_SimplexP(1) +DEAL::Generated : +DEAL::FE_SimplexP<2>(1) +DEAL::Read FE_SimplexP(1) +DEAL::Generated : +DEAL::FE_SimplexP<3>(1) +DEAL::Read FE_SimplexP(2) +DEAL::Generated : +DEAL::FE_SimplexP<1>(2) +DEAL::Read FE_SimplexP(2) +DEAL::Generated : +DEAL::FE_SimplexP<1>(2) +DEAL::Read FE_SimplexP(2) +DEAL::Generated : +DEAL::FE_SimplexP<2>(2) +DEAL::Read FE_SimplexP(2) +DEAL::Generated : +DEAL::FE_SimplexP<1>(2) +DEAL::Read FE_SimplexP(2) +DEAL::Generated : +DEAL::FE_SimplexP<2>(2) +DEAL::Read FE_SimplexP(2) +DEAL::Generated : +DEAL::FE_SimplexP<3>(2) +DEAL::Read FE_SimplexDGP(1) +DEAL::Generated : +DEAL::FE_SimplexDGP<1>(1) +DEAL::Read FE_SimplexDGP(1) +DEAL::Generated : +DEAL::FE_SimplexDGP<1>(1) +DEAL::Read FE_SimplexDGP(1) +DEAL::Generated : +DEAL::FE_SimplexDGP<2>(1) +DEAL::Read FE_SimplexDGP(1) +DEAL::Generated : +DEAL::FE_SimplexDGP<1>(1) +DEAL::Read FE_SimplexDGP(1) +DEAL::Generated : +DEAL::FE_SimplexDGP<2>(1) +DEAL::Read FE_SimplexDGP(1) +DEAL::Generated : +DEAL::FE_SimplexDGP<3>(1) +DEAL::Read FE_SimplexDGP(2) +DEAL::Generated : +DEAL::FE_SimplexDGP<1>(2) +DEAL::Read FE_SimplexDGP(2) +DEAL::Generated : +DEAL::FE_SimplexDGP<1>(2) +DEAL::Read FE_SimplexDGP(2) +DEAL::Generated : +DEAL::FE_SimplexDGP<2>(2) +DEAL::Read FE_SimplexDGP(2) +DEAL::Generated : +DEAL::FE_SimplexDGP<1>(2) +DEAL::Read FE_SimplexDGP(2) +DEAL::Generated : +DEAL::FE_SimplexDGP<2>(2) +DEAL::Read FE_SimplexDGP(2) +DEAL::Generated : +DEAL::FE_SimplexDGP<3>(2) +DEAL::Read FE_SimplexP_Bubbles(2) +DEAL::Generated : +DEAL::FE_SimplexP_Bubbles<1>(2) +DEAL::Read FE_SimplexP_Bubbles(2) +DEAL::Generated : +DEAL::FE_SimplexP_Bubbles<1,2>(2) +DEAL::Read FE_SimplexP_Bubbles(2) +DEAL::Generated : +DEAL::FE_SimplexP_Bubbles<2>(2) +DEAL::Read FE_SimplexP_Bubbles(2) +DEAL::Generated : +DEAL::FE_SimplexP_Bubbles<1,3>(2) +DEAL::Read FE_SimplexP_Bubbles(2) +DEAL::Generated : +DEAL::FE_SimplexP_Bubbles<2,3>(2) +DEAL::Read FE_SimplexP_Bubbles(2) +DEAL::Generated : +DEAL::FE_SimplexP_Bubbles<3>(2) +DEAL::Read FE_PyramidP(1) +DEAL::Generated : +DEAL::FE_PyramidP<3>(1) +DEAL::Read FE_PyramidDGP(1) +DEAL::Generated : +DEAL::FE_PyramidDGP<3>(1) +DEAL::Read FE_WedgeP(1) +DEAL::Generated : +DEAL::FE_WedgeP<3>(1) +DEAL::Read FE_WedgeDGP(1) +DEAL::Generated : +DEAL::FE_WedgeDGP<3>(1) DEAL::Read FESystem[FE_Q_Hierarchical(1)^2-FE_Q_Hierarchical(1)] DEAL::Generated : DEAL::FESystem<1>[FE_Q_Hierarchical<1>(1)^2-FE_Q_Hierarchical<1>(1)]