]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use linear Q1 mapping even in places where we know that that may be wrong.
authorWolfgang Bangerth <bangerth@colostate.edu>
Thu, 14 Jan 2021 00:02:50 +0000 (17:02 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Thu, 14 Jan 2021 16:03:43 +0000 (09:03 -0700)
include/deal.II/fe/fe_interface_values.h
include/deal.II/fe/fe_tools.templates.h
include/deal.II/grid/grid_tools.h
include/deal.II/grid/grid_tools_cache.h
include/deal.II/numerics/vector_tools_constraints.h
include/deal.II/particles/generators.h

index 0b581f237d1afe57aac9af85bbe972d9e5f5d69b..5887207b752b58657b4df44e0a7c280bd25a7872 100644 (file)
@@ -525,22 +525,38 @@ FEInterfaceValues<dim, spacedim>::FEInterfaceValues(
   const Quadrature<dim - 1> &         quadrature,
   const UpdateFlags                   update_flags)
   : n_quadrature_points(quadrature.size())
-  , internal_fe_face_values(StaticMappingQ1<dim, spacedim>::mapping,
-                            fe,
-                            quadrature,
-                            update_flags)
-  , internal_fe_subface_values(StaticMappingQ1<dim, spacedim>::mapping,
-                               fe,
-                               quadrature,
-                               update_flags)
-  , internal_fe_face_values_neighbor(StaticMappingQ1<dim, spacedim>::mapping,
-                                     fe,
-                                     quadrature,
-                                     update_flags)
-  , internal_fe_subface_values_neighbor(StaticMappingQ1<dim, spacedim>::mapping,
-                                        fe,
-                                        quadrature,
-                                        update_flags)
+  , internal_fe_face_values(
+      // 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)
+  , internal_fe_subface_values(
+      // 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)
+  , internal_fe_face_values_neighbor(
+      // 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)
+  , internal_fe_subface_values_neighbor(
+      // 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)
   , fe_face_values(nullptr)
   , fe_face_values_neighbor(nullptr)
 {}
index fe4cdfc29222ee725200278aedb9b282bfae98d8..137ab656e3d7857a2f72c9e3379b830c026bf68d 100644 (file)
@@ -2265,11 +2265,14 @@ namespace FETools
         tr.begin_active()->set_refine_flag(RefinementCase<dim>(ref_case));
         tr.execute_coarsening_and_refinement();
 
-        FEValues<dim, spacedim> fine(StaticMappingQ1<dim, spacedim>::mapping,
-                                     fe,
-                                     q_fine,
-                                     update_quadrature_points |
-                                       update_JxW_values | update_values);
+        FEValues<dim, spacedim> fine(
+          // 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,
+          q_fine,
+          update_quadrature_points | update_JxW_values | update_values);
 
         typename Triangulation<dim, spacedim>::cell_iterator coarse_cell =
           tr.begin(0);
index ae933ff775500fdebd3aedb9d061b0363ccba72b..c464e21576ee0a50b0b6700ea03a57aed5bc6ea7 100644 (file)
@@ -176,7 +176,8 @@ namespace GridTools
   double
   volume(const Triangulation<dim, spacedim> &tria,
          const Mapping<dim, spacedim> &      mapping =
-           (StaticMappingQ1<dim, spacedim>::mapping));
+           ReferenceCell::get_default_linear_mapping<dim, spacedim>(
+             ReferenceCell::get_hypercube(dim)));
 
   /**
    * Return an approximation of the diameter of the smallest active cell of a
@@ -190,9 +191,11 @@ namespace GridTools
    */
   template <int dim, int spacedim>
   double
-  minimal_cell_diameter(const Triangulation<dim, spacedim> &triangulation,
-                        const Mapping<dim, spacedim> &      mapping =
-                          (StaticMappingQ1<dim, spacedim>::mapping));
+  minimal_cell_diameter(
+    const Triangulation<dim, spacedim> &triangulation,
+    const Mapping<dim, spacedim> &      mapping =
+      ReferenceCell::get_default_linear_mapping<dim, spacedim>(
+        ReferenceCell::get_hypercube(dim)));
 
   /**
    * Return an approximation of the diameter of the largest active cell of a
@@ -206,9 +209,11 @@ namespace GridTools
    */
   template <int dim, int spacedim>
   double
-  maximal_cell_diameter(const Triangulation<dim, spacedim> &triangulation,
-                        const Mapping<dim, spacedim> &      mapping =
-                          (StaticMappingQ1<dim, spacedim>::mapping));
+  maximal_cell_diameter(
+    const Triangulation<dim, spacedim> &triangulation,
+    const Mapping<dim, spacedim> &      mapping =
+      ReferenceCell::get_default_linear_mapping<dim, spacedim>(
+        ReferenceCell::get_hypercube(dim)));
 
   /**
    * Given a list of vertices (typically obtained using
@@ -1036,9 +1041,11 @@ namespace GridTools
    */
   template <int dim, int spacedim>
   std::map<unsigned int, Point<spacedim>>
-  extract_used_vertices(const Triangulation<dim, spacedim> &container,
-                        const Mapping<dim, spacedim> &      mapping =
-                          StaticMappingQ1<dim, spacedim>::mapping);
+  extract_used_vertices(
+    const Triangulation<dim, spacedim> &container,
+    const Mapping<dim, spacedim> &      mapping =
+      ReferenceCell::get_default_linear_mapping<dim, spacedim>(
+        ReferenceCell::get_hypercube(dim)));
 
   /**
    * Find and return the index of the closest vertex to a given point in the
@@ -1865,7 +1872,8 @@ namespace GridTools
     const typename Triangulation<dim, spacedim>::active_cell_iterator &cell,
     const Point<spacedim> &                                            position,
     const Mapping<dim, spacedim> &                                     mapping =
-      StaticMappingQ1<dim, spacedim>::mapping);
+      ReferenceCell::get_default_linear_mapping<dim, spacedim>(
+        ReferenceCell::get_hypercube(dim)));
 
   /**
    * Compute a globally unique index for each vertex and hanging node
index c575240bcde7943ae608aed0a5f71565392ebb7b..e2fbe37a485bc298f2ae94950740fd8fed74f952 100644 (file)
@@ -76,7 +76,8 @@ namespace GridTools
      */
     Cache(const Triangulation<dim, spacedim> &tria,
           const Mapping<dim, spacedim> &      mapping =
-            StaticMappingQ1<dim, spacedim>::mapping);
+            ReferenceCell::get_default_linear_mapping<dim, spacedim>(
+              ReferenceCell::get_hypercube(dim)));
 
     /**
      * Destructor.
index e1daae474e62e3a39cc82e7ba5e88300b3239624..84c6d56c7eca442b07dfee49b33bf98d968be4a2 100644 (file)
@@ -280,7 +280,8 @@ namespace VectorTools
       &                           function_map,
     AffineConstraints<double> &   constraints,
     const Mapping<dim, spacedim> &mapping =
-      StaticMappingQ1<dim, spacedim>::mapping);
+      ReferenceCell::get_default_linear_mapping<dim, spacedim>(
+        ReferenceCell::get_hypercube(dim)));
 
   /**
    * This function does the same as the
@@ -302,7 +303,8 @@ namespace VectorTools
     const std::set<types::boundary_id> &boundary_ids,
     AffineConstraints<double> &         constraints,
     const Mapping<dim, spacedim> &      mapping =
-      StaticMappingQ1<dim, spacedim>::mapping);
+      ReferenceCell::get_default_linear_mapping<dim,spacedim>(
+        ReferenceCell::get_hypercube(dim)));
 
   /**
    * Compute the constraints that correspond to boundary conditions of the
@@ -330,7 +332,8 @@ namespace VectorTools
       &                           function_map,
     AffineConstraints<double> &   constraints,
     const Mapping<dim, spacedim> &mapping =
-      StaticMappingQ1<dim, spacedim>::mapping);
+      ReferenceCell::get_default_linear_mapping<dim,spacedim>(
+        ReferenceCell::get_hypercube(dim)));
 
   /**
    * Same as above for homogeneous tangential-flux constraints.
@@ -348,7 +351,8 @@ namespace VectorTools
     const std::set<types::boundary_id> &boundary_ids,
     AffineConstraints<double> &         constraints,
     const Mapping<dim, spacedim> &      mapping =
-      StaticMappingQ1<dim, spacedim>::mapping);
+      ReferenceCell::get_default_linear_mapping<dim,spacedim>(
+        ReferenceCell::get_hypercube(dim)));
 
   //@}
 } // namespace VectorTools
index 700050d5f46157c575e42cdbdf68d8d446a9201f..994ef896ed146eb2c160dd9d2db41a6165a7c702 100644 (file)
@@ -69,7 +69,8 @@ namespace Particles
       const std::vector<Point<dim>> &     particle_reference_locations,
       ParticleHandler<dim, spacedim> &    particle_handler,
       const Mapping<dim, spacedim> &      mapping =
-        StaticMappingQ1<dim, spacedim>::mapping);
+        ReferenceCell::get_default_linear_mapping<dim, spacedim>(
+          ReferenceCell::get_hypercube(dim)));
 
     /**
      * A function that generates one particle at a random location in cell @p cell and with
@@ -107,7 +108,8 @@ namespace Particles
       const types::particle_index                                        id,
       std::mt19937 &                random_number_generator,
       const Mapping<dim, spacedim> &mapping =
-        StaticMappingQ1<dim, spacedim>::mapping);
+        ReferenceCell::get_default_linear_mapping<dim, spacedim>(
+          ReferenceCell::get_hypercube(dim)));
 
     /**
      * A function that generates particles randomly in the domain with a
@@ -162,7 +164,8 @@ namespace Particles
       const types::particle_index         n_particles_to_create,
       ParticleHandler<dim, spacedim> &    particle_handler,
       const Mapping<dim, spacedim> &      mapping =
-        StaticMappingQ1<dim, spacedim>::mapping,
+        ReferenceCell::get_default_linear_mapping<dim, spacedim>(
+          ReferenceCell::get_hypercube(dim)),
       const unsigned int random_number_seed = 5432);
 
 
@@ -202,14 +205,16 @@ namespace Particles
      */
     template <int dim, int spacedim = dim>
     void
-    dof_support_points(const DoFHandler<dim, spacedim> &dof_handler,
-                       const std::vector<std::vector<BoundingBox<spacedim>>>
-                         &                             global_bounding_boxes,
-                       ParticleHandler<dim, spacedim> &particle_handler,
-                       const Mapping<dim, spacedim> &  mapping =
-                         StaticMappingQ1<dim, spacedim>::mapping,
-                       const ComponentMask &components = ComponentMask(),
-                       const std::vector<std::vector<double>> &properties = {});
+    dof_support_points(
+      const DoFHandler<dim, spacedim> &dof_handler,
+      const std::vector<std::vector<BoundingBox<spacedim>>>
+        &                             global_bounding_boxes,
+      ParticleHandler<dim, spacedim> &particle_handler,
+      const Mapping<dim, spacedim> &  mapping =
+        ReferenceCell::get_default_linear_mapping<dim, spacedim>(
+          ReferenceCell::get_hypercube(dim)),
+      const ComponentMask &                   components = ComponentMask(),
+      const std::vector<std::vector<double>> &properties = {});
 
     /**
      * A function that generates particles at the locations of the quadrature
@@ -244,14 +249,16 @@ namespace Particles
      */
     template <int dim, int spacedim = dim>
     void
-    quadrature_points(const Triangulation<dim, spacedim> &triangulation,
-                      const Quadrature<dim> &             quadrature,
-                      const std::vector<std::vector<BoundingBox<spacedim>>>
-                        &                             global_bounding_boxes,
-                      ParticleHandler<dim, spacedim> &particle_handler,
-                      const Mapping<dim, spacedim> &  mapping =
-                        StaticMappingQ1<dim, spacedim>::mapping,
-                      const std::vector<std::vector<double>> &properties = {});
+    quadrature_points(
+      const Triangulation<dim, spacedim> &triangulation,
+      const Quadrature<dim> &             quadrature,
+      const std::vector<std::vector<BoundingBox<spacedim>>>
+        &                             global_bounding_boxes,
+      ParticleHandler<dim, spacedim> &particle_handler,
+      const Mapping<dim, spacedim> &  mapping =
+        ReferenceCell::get_default_linear_mapping<dim, spacedim>(
+          ReferenceCell::get_hypercube(dim)),
+      const std::vector<std::vector<double>> &properties = {});
   } // namespace Generators
 } // namespace Particles
 

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.