]> https://gitweb.dealii.org/ - dealii.git/commitdiff
ReferenceCell: make MappingP1 the default. 18586/head
authorDavid Wells <drwells@email.unc.edu>
Thu, 26 Jun 2025 03:25:17 +0000 (23:25 -0400)
committerDavid Wells <drwells@email.unc.edu>
Tue, 1 Jul 2025 13:26:25 +0000 (09:26 -0400)
doc/news/changes/major/20250626Wells [new file with mode: 0644]
source/grid/reference_cell.cc

diff --git a/doc/news/changes/major/20250626Wells b/doc/news/changes/major/20250626Wells
new file mode 100644 (file)
index 0000000..0173831
--- /dev/null
@@ -0,0 +1,7 @@
+New: Added a new class MappingP1, which is now the default linear simplex mapping
+(i.e., it is the mapping returned by ReferenceCell::get_default_linear_mapping()).
+This mapping is significantly more efficient than MappingFE for linear simplex
+elements: e.g., Mapping::fill_fe_values() is about 6x faster in a simple load
+vector benchmark.
+<br>
+(David Wells, 2025/06/26)
index 264355627e19637676faef9fc167dce5ba6e88ff..d1ab57279c80f60c8fc53953b3fd5cc04cc2f396 100644 (file)
@@ -22,6 +22,7 @@
 #include <deal.II/fe/fe_simplex_p_bubbles.h>
 #include <deal.II/fe/fe_wedge_p.h>
 #include <deal.II/fe/mapping_fe.h>
+#include <deal.II/fe/mapping_p1.h>
 #include <deal.II/fe/mapping_q.h>
 #include <deal.II/fe/mapping_q1.h>
 
@@ -295,8 +296,7 @@ ReferenceCell::get_default_linear_mapping() const
     }
   else if (is_simplex())
     {
-      static const MappingFE<dim, spacedim> mapping(
-        FE_SimplexP<dim, spacedim>(1));
+      static const MappingP1<dim, spacedim> mapping;
       return mapping;
     }
   else if (*this == ReferenceCells::Pyramid)

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.