]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use ReferenceCell::get_default_linear_mapping() in the .cc files.
authorWolfgang Bangerth <bangerth@colostate.edu>
Wed, 13 Jan 2021 23:38:54 +0000 (16:38 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Thu, 14 Jan 2021 00:05:39 +0000 (17:05 -0700)
source/fe/fe_q_bubbles.cc
source/fe/fe_values.cc
source/fe/mapping_fe_field.cc
source/grid/grid_tools_dof_handlers.cc
source/grid/tria.cc
source/grid/tria_accessor.cc
source/meshworker/scratch_data.cc
source/numerics/derivative_approximation.cc

index 3f2f9ab232a0b322745c76e8e51158385de5053a..8625b8e0ad6db4559f5261926d4dba69b6739298 100644 (file)
@@ -122,7 +122,7 @@ namespace internal
             dh.distribute_dofs(fe);
 
             dealii::FEValues<dim, spacedim> fine(
-              StaticMappingQ1<dim, spacedim>::mapping,
+              ReferenceCell::get_default_linear_mapping(tr),
               fe,
               *q_fine,
               update_quadrature_points | update_JxW_values | update_values);
index 95b6521ff4052a1411f8995cfd4a7e8423eedcfd..234dc9f9e6b5c2eacdff5a13eec4452f1e08e19f 100644 (file)
@@ -4384,11 +4384,15 @@ template <int dim, int spacedim>
 FEValues<dim, spacedim>::FEValues(const FiniteElement<dim, spacedim> &fe,
                                   const Quadrature<dim> &             q,
                                   const UpdateFlags update_flags)
-  : FEValuesBase<dim, spacedim>(q.size(),
-                                fe.n_dofs_per_cell(),
-                                update_default,
-                                StaticMappingQ1<dim, spacedim>::mapping,
-                                fe)
+  : FEValuesBase<dim, spacedim>(
+      q.size(),
+      fe.n_dofs_per_cell(),
+      update_default,
+      // TODO: We should query the default mapping for the kind of cell
+      // represented by 'fe' and 'q':
+      ReferenceCell::get_default_linear_mapping<dim, spacedim>(
+        ReferenceCell::get_hypercube(dim)),
+      fe)
   , quadrature(q)
 {
   initialize(update_flags);
@@ -4709,11 +4713,15 @@ FEFaceValues<dim, spacedim>::FEFaceValues(
   const FiniteElement<dim, spacedim> &fe,
   const hp::QCollection<dim - 1> &    quadrature,
   const UpdateFlags                   update_flags)
-  : FEFaceValuesBase<dim, spacedim>(fe.n_dofs_per_cell(),
-                                    update_flags,
-                                    StaticMappingQ1<dim, spacedim>::mapping,
-                                    fe,
-                                    quadrature)
+  : FEFaceValuesBase<dim, spacedim>(
+      fe.n_dofs_per_cell(),
+      update_flags,
+      // TODO: We should query the default mapping for the kind of cell
+      // represented by 'fe' and 'q':
+      ReferenceCell::get_default_linear_mapping<dim, spacedim>(
+        ReferenceCell::get_hypercube(dim)),
+      fe,
+      quadrature)
 {
   initialize(update_flags);
 }
@@ -4939,11 +4947,15 @@ FESubfaceValues<dim, spacedim>::FESubfaceValues(
   const FiniteElement<dim, spacedim> &fe,
   const Quadrature<dim - 1> &         quadrature,
   const UpdateFlags                   update_flags)
-  : FEFaceValuesBase<dim, spacedim>(fe.n_dofs_per_cell(),
-                                    update_flags,
-                                    StaticMappingQ1<dim, spacedim>::mapping,
-                                    fe,
-                                    quadrature)
+  : FEFaceValuesBase<dim, spacedim>(
+      fe.n_dofs_per_cell(),
+      update_flags,
+      // TODO: We should query the default mapping for the kind of cell
+      // represented by 'fe' and 'q':
+      ReferenceCell::get_default_linear_mapping<dim, spacedim>(
+        ReferenceCell::get_hypercube(dim)),
+      fe,
+      quadrature)
 {
   initialize(update_flags);
 }
index 31470830edbac983952faffeab613ec638c2cbff..61da31d4445b0b2d6d22939e18f971354cfccd52 100644 (file)
@@ -2084,8 +2084,8 @@ MappingFEField<dim, spacedim, VectorType, void>::transform_real_to_unit_cell(
   try
     {
       initial_p_unit =
-        StaticMappingQ1<dim, spacedim>::mapping.transform_real_to_unit_cell(
-          cell, p);
+        ReferenceCell::get_default_linear_mapping(cell->get_triangulation())
+          .transform_real_to_unit_cell(cell, p);
     }
   catch (const typename Mapping<dim, spacedim>::ExcTransformationFailed &)
     {
index a4d99be7b8e403d21706680c688a4eb5780cb1f6..339d64e1f005382a9809a64582aef0fc2b66930f 100644 (file)
@@ -419,7 +419,8 @@ namespace GridTools
                                 const double                   tolerance)
   {
     return find_active_cell_around_point<dim, MeshType, spacedim>(
-             StaticMappingQ1<dim, spacedim>::mapping,
+             ReferenceCell::get_default_linear_mapping(
+               mesh.get_triangulation()),
              mesh,
              p,
              marked_vertices,
@@ -2379,6 +2380,7 @@ namespace GridTools
   {
     using MATCH_T =
       std::array<unsigned int, GeometryInfo<3>::vertices_per_face>;
+
     static inline std::bitset<3>
     lookup(const MATCH_T &matching)
     {
index dc48caea96cb057e84bfecc7e27e0e5ccb30b3c0..5eadb32ab419268089dd8e3985635ef4b69d7ae2 100644 (file)
@@ -9607,9 +9607,11 @@ namespace internal
                         // one.
                         const Point<spacedim> new_bound = face->center(true);
                         // to check it, transform to the unit cell
-                        // with Q1Mapping
+                        // with a linear mapping
                         const Point<dim> new_unit =
-                          StaticMappingQ1<dim, spacedim>::mapping
+                          ReferenceCell::get_default_linear_mapping<dim,
+                                                                    spacedim>(
+                            cell->reference_cell_type())
                             .transform_real_to_unit_cell(cell, new_bound);
 
                         // Now, we have to calculate the distance from
index 6c9aceaaac917861ffecb92d7505a60dc05a4f0b..0260bf31b7f09ce5e324f2b20b89c71aae45ca49 100644 (file)
@@ -1859,8 +1859,9 @@ CellAccessor<3>::point_inside(const Point<3> &p) const
     {
       const TriaRawIterator<CellAccessor<dim, spacedim>> cell_iterator(*this);
       return (GeometryInfo<dim>::is_inside_unit_cell(
-        StaticMappingQ1<dim, spacedim>::mapping.transform_real_to_unit_cell(
-          cell_iterator, p)));
+        ReferenceCell::get_default_linear_mapping<dim, spacedim>(
+          reference_cell_type())
+          .transform_real_to_unit_cell(cell_iterator, p)));
     }
   catch (const Mapping<dim, spacedim>::ExcTransformationFailed &)
     {
index 4edb59a4e3b1e0ebfbcc03cd2baddbccb330629d..17772fee136083834a00e92167579a6312b85aff 100644 (file)
@@ -74,12 +74,16 @@ namespace MeshWorker
     const UpdateFlags &                 update_flags,
     const Quadrature<dim - 1> &         face_quadrature,
     const UpdateFlags &                 face_update_flags)
-    : ScratchData(StaticMappingQ1<dim, spacedim>::mapping,
-                  fe,
-                  quadrature,
-                  update_flags,
-                  face_quadrature,
-                  face_update_flags)
+    : ScratchData(
+        // TODO: We should query the default mapping for the kind of cell
+        // represented by 'fe' and 'q':
+        ReferenceCell::get_default_linear_mapping<dim, spacedim>(
+          ReferenceCell::get_hypercube(dim)),
+        fe,
+        quadrature,
+        update_flags,
+        face_quadrature,
+        face_update_flags)
   {}
 
 
@@ -93,14 +97,18 @@ namespace MeshWorker
     const Quadrature<dim - 1> &         face_quadrature,
     const UpdateFlags &                 face_update_flags,
     const UpdateFlags &                 neighbor_face_update_flags)
-    : ScratchData(StaticMappingQ1<dim, spacedim>::mapping,
-                  fe,
-                  quadrature,
-                  update_flags,
-                  neighbor_update_flags,
-                  face_quadrature,
-                  face_update_flags,
-                  neighbor_face_update_flags)
+    : ScratchData(
+        // TODO: We should query the default mapping for the kind of cell
+        // represented by 'fe' and 'q':
+        ReferenceCell::get_default_linear_mapping<dim, spacedim>(
+          ReferenceCell::get_hypercube(dim)),
+        fe,
+        quadrature,
+        update_flags,
+        neighbor_update_flags,
+        face_quadrature,
+        face_update_flags,
+        neighbor_face_update_flags)
   {}
 
 
index f8b75fb40e1e8cf1bc5430428389dded05e76524..0af8face47b59baabb5805f289d0d0065e1b10b0 100644 (file)
@@ -25,6 +25,7 @@
 
 #include <deal.II/grid/filtered_iterator.h>
 #include <deal.II/grid/grid_tools.h>
+#include <deal.II/grid/reference_cell.h>
 #include <deal.II/grid/tria_iterator.h>
 
 #include <deal.II/hp/fe_collection.h>
@@ -1099,12 +1100,14 @@ namespace DerivativeApproximation
     const unsigned int  component)
   {
     // just call the respective function with Q1 mapping
-    approximate_derivative_tensor(StaticMappingQ1<dim, spacedim>::mapping,
-                                  dof,
-                                  solution,
-                                  cell,
-                                  derivative,
-                                  component);
+    approximate_derivative_tensor(
+      ReferenceCell::get_default_linear_mapping<dim, spacedim>(
+        cell->reference_cell_type()),
+      dof,
+      solution,
+      cell,
+      derivative,
+      component);
   }
 
 

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.