]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Make sure get_fe_by_name works for simplices. 15683/head
authorLuca Heltai <luca.heltai@sissa.it>
Sat, 8 Jul 2023 09:12:38 +0000 (11:12 +0200)
committerLuca Heltai <luca.heltai@sissa.it>
Sat, 8 Jul 2023 09:12:38 +0000 (11:12 +0200)
doc/news/changes/minor/20230708LucaHeltai [new file with mode: 0644]
include/deal.II/fe/fe_tools.templates.h
tests/fe/get_fe_by_name_01.cc
tests/fe/get_fe_by_name_01.output

diff --git a/doc/news/changes/minor/20230708LucaHeltai b/doc/news/changes/minor/20230708LucaHeltai
new file mode 100644 (file)
index 0000000..cc7f975
--- /dev/null
@@ -0,0 +1,3 @@
+Fixed: FETools::get_fe_by_name() now works also for simplex finite elements.
+<br>
+(Luca Heltai, 2023/07/08)
index 0b9b532e5e05bbfcb72751917ca92117e91d8fdb..4bfc3b9fef40b4d7d9cf98abff0413ceab17f002 100644 (file)
@@ -42,6 +42,7 @@
 #include <deal.II/fe/fe_nedelec.h>
 #include <deal.II/fe/fe_nedelec_sz.h>
 #include <deal.II/fe/fe_nothing.h>
+#include <deal.II/fe/fe_pyramid_p.h>
 #include <deal.II/fe/fe_q.h>
 #include <deal.II/fe/fe_q_bubbles.h>
 #include <deal.II/fe/fe_q_dg0.h>
 #include <deal.II/fe/fe_rannacher_turek.h>
 #include <deal.II/fe/fe_raviart_thomas.h>
 #include <deal.II/fe/fe_rt_bubbles.h>
+#include <deal.II/fe/fe_simplex_p.h>
+#include <deal.II/fe/fe_simplex_p_bubbles.h>
 #include <deal.II/fe/fe_system.h>
 #include <deal.II/fe/fe_tools.h>
 #include <deal.II/fe/fe_values.h>
+#include <deal.II/fe/fe_wedge_p.h>
 #include <deal.II/fe/mapping_cartesian.h>
 
 #include <deal.II/grid/grid_generator.h>
@@ -1125,6 +1129,25 @@ namespace FETools
           std::make_unique<FETools::FEFactory<FE_Nothing<dim>>>();
         result["FE_RannacherTurek"] =
           std::make_unique<FETools::FEFactory<FE_RannacherTurek<dim>>>();
+        // Simplex finite elements
+        result["FE_SimplexP"] =
+          std::make_unique<FETools::FEFactory<FE_SimplexP<dim>>>();
+        result["FE_SimplexDGP"] =
+          std::make_unique<FETools::FEFactory<FE_SimplexDGP<dim>>>();
+        result["FE_SimplexP_Bubbles"] =
+          std::make_unique<FETools::FEFactory<FE_SimplexP_Bubbles<dim>>>();
+        // Mixed grids finite elements -- only valid in 3d
+        if constexpr (dim == 3)
+          {
+            result["FE_PyramidP"] =
+              std::make_unique<FETools::FEFactory<FE_PyramidP<dim>>>();
+            result["FE_PyramidDGP"] =
+              std::make_unique<FETools::FEFactory<FE_PyramidDGP<dim>>>();
+            result["FE_WedgeP"] =
+              std::make_unique<FETools::FEFactory<FE_WedgeP<dim>>>();
+            result["FE_WedgeDGP"] =
+              std::make_unique<FETools::FEFactory<FE_WedgeDGP<dim>>>();
+          }
       }
 
 
@@ -1161,6 +1184,12 @@ namespace FETools
           std::make_unique<FETools::FEFactory<FE_Q<dim, spacedim>>>();
         result["FE_Bernstein"] =
           std::make_unique<FETools::FEFactory<FE_Bernstein<dim, spacedim>>>();
+        result["FE_SimplexP"] =
+          std::make_unique<FETools::FEFactory<FE_SimplexP<dim, spacedim>>>();
+        result["FE_SimplexDGP"] =
+          std::make_unique<FETools::FEFactory<FE_SimplexDGP<dim, spacedim>>>();
+        result["FE_SimplexP_Bubbles"] = std::make_unique<
+          FETools::FEFactory<FE_SimplexP_Bubbles<dim, spacedim>>>();
       }
 
       // 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
index 38a99d72df2fce65350648bc74dca529e9efc74a..8b832c18c77d7db42e5a373c6306da9d9ca49652 100644 (file)
@@ -36,11 +36,11 @@ public:
   generate(const char *myname)
   {
     std::string name = myname;
+    deallog << "Read " << name << std::endl;
 
     std::unique_ptr<FiniteElement<dim, spacedim>> fe =
       FETools::get_fe_by_name<dim, spacedim>(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(
index f2249c8265d4b4a9c26390b951ce69b729ee78e2..16931bb955a7b4925e122ed2dc82ebabf7a816c1 100644 (file)
@@ -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)]

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.