]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Make KellyErrorEstimator use ReadVector.
authorDavid Wells <drwells@email.unc.edu>
Sat, 13 May 2023 14:04:47 +0000 (10:04 -0400)
committerDavid Wells <drwells@email.unc.edu>
Sat, 1 Jul 2023 14:21:47 +0000 (10:21 -0400)
include/deal.II/numerics/error_estimator.h
include/deal.II/numerics/error_estimator.templates.h
source/numerics/error_estimator.inst.in
source/numerics/error_estimator_1d.cc
source/numerics/error_estimator_1d.inst.in

index ecf4c1fb83e005acbee421a85745a47cdee0b414..92c67404d87d83c7fe59e02ff8495e3e46e7b9cf 100644 (file)
@@ -336,16 +336,15 @@ public:
    * cell in the mesh as reported by
    * parallel::distributed::Triangulation::n_locally_owned_active_cells().
    */
-  template <typename InputVector>
+  template <typename Number>
   static void
   estimate(
     const Mapping<dim, spacedim> &   mapping,
     const DoFHandler<dim, spacedim> &dof,
     const Quadrature<dim - 1> &      quadrature,
-    const std::map<types::boundary_id,
-                   const Function<spacedim, typename InputVector::value_type> *>
+    const std::map<types::boundary_id, const Function<spacedim, Number> *>
       &                       neumann_bc,
-    const InputVector &       solution,
+    const ReadVector<Number> &solution,
     Vector<float> &           error,
     const ComponentMask &     component_mask = ComponentMask(),
     const Function<spacedim> *coefficients   = nullptr,
@@ -358,15 +357,14 @@ public:
    * Call the @p estimate function, see above, with
    * <tt>mapping=MappingQ@<dim@>(1)</tt>.
    */
-  template <typename InputVector>
+  template <typename Number>
   static void
   estimate(
     const DoFHandler<dim, spacedim> &dof,
     const Quadrature<dim - 1> &      quadrature,
-    const std::map<types::boundary_id,
-                   const Function<spacedim, typename InputVector::value_type> *>
+    const std::map<types::boundary_id, const Function<spacedim, Number> *>
       &                       neumann_bc,
-    const InputVector &       solution,
+    const ReadVector<Number> &solution,
     Vector<float> &           error,
     const ComponentMask &     component_mask = ComponentMask(),
     const Function<spacedim> *coefficients   = nullptr,
@@ -388,60 +386,57 @@ public:
    * construct of vector of references, so we had to use a vector of
    * pointers.)
    */
-  template <typename InputVector>
+  template <typename Number>
   static void
   estimate(
     const Mapping<dim, spacedim> &   mapping,
     const DoFHandler<dim, spacedim> &dof,
     const Quadrature<dim - 1> &      quadrature,
-    const std::map<types::boundary_id,
-                   const Function<spacedim, typename InputVector::value_type> *>
-      &                                     neumann_bc,
-    const std::vector<const InputVector *> &solutions,
-    std::vector<Vector<float> *> &          errors,
-    const ComponentMask &                   component_mask = ComponentMask(),
-    const Function<spacedim> *              coefficients   = nullptr,
-    const unsigned int        n_threads    = numbers::invalid_unsigned_int,
-    const types::subdomain_id subdomain_id = numbers::invalid_subdomain_id,
-    const types::material_id  material_id  = numbers::invalid_material_id,
-    const Strategy            strategy     = cell_diameter_over_24);
+    const std::map<types::boundary_id, const Function<spacedim, Number> *>
+      &                                            neumann_bc,
+    const std::vector<const ReadVector<Number> *> &solutions,
+    std::vector<Vector<float> *> &                 errors,
+    const ComponentMask &     component_mask = ComponentMask(),
+    const Function<spacedim> *coefficients   = nullptr,
+    const unsigned int        n_threads      = numbers::invalid_unsigned_int,
+    const types::subdomain_id subdomain_id   = numbers::invalid_subdomain_id,
+    const types::material_id  material_id    = numbers::invalid_material_id,
+    const Strategy            strategy       = cell_diameter_over_24);
 
   /**
    * Call the @p estimate function, see above, with
    * <tt>mapping=MappingQ@<dim@>(1)</tt>.
    */
-  template <typename InputVector>
+  template <typename Number>
   static void
   estimate(
     const DoFHandler<dim, spacedim> &dof,
     const Quadrature<dim - 1> &      quadrature,
-    const std::map<types::boundary_id,
-                   const Function<spacedim, typename InputVector::value_type> *>
-      &                                     neumann_bc,
-    const std::vector<const InputVector *> &solutions,
-    std::vector<Vector<float> *> &          errors,
-    const ComponentMask &                   component_mask = ComponentMask(),
-    const Function<spacedim> *              coefficients   = nullptr,
-    const unsigned int        n_threads    = numbers::invalid_unsigned_int,
-    const types::subdomain_id subdomain_id = numbers::invalid_subdomain_id,
-    const types::material_id  material_id  = numbers::invalid_material_id,
-    const Strategy            strategy     = cell_diameter_over_24);
+    const std::map<types::boundary_id, const Function<spacedim, Number> *>
+      &                                            neumann_bc,
+    const std::vector<const ReadVector<Number> *> &solutions,
+    std::vector<Vector<float> *> &                 errors,
+    const ComponentMask &     component_mask = ComponentMask(),
+    const Function<spacedim> *coefficients   = nullptr,
+    const unsigned int        n_threads      = numbers::invalid_unsigned_int,
+    const types::subdomain_id subdomain_id   = numbers::invalid_subdomain_id,
+    const types::material_id  material_id    = numbers::invalid_material_id,
+    const Strategy            strategy       = cell_diameter_over_24);
 
 
   /**
    * Equivalent to the set of functions above, except that this one takes a
    * quadrature collection for hp-finite element dof handlers.
    */
-  template <typename InputVector>
+  template <typename Number>
   static void
   estimate(
     const Mapping<dim, spacedim> &   mapping,
     const DoFHandler<dim, spacedim> &dof,
     const hp::QCollection<dim - 1> & quadrature,
-    const std::map<types::boundary_id,
-                   const Function<spacedim, typename InputVector::value_type> *>
+    const std::map<types::boundary_id, const Function<spacedim, Number> *>
       &                       neumann_bc,
-    const InputVector &       solution,
+    const ReadVector<Number> &solution,
     Vector<float> &           error,
     const ComponentMask &     component_mask = ComponentMask(),
     const Function<spacedim> *coefficients   = nullptr,
@@ -455,15 +450,14 @@ public:
    * Equivalent to the set of functions above, except that this one takes a
    * quadrature collection for hp-finite element dof handlers.
    */
-  template <typename InputVector>
+  template <typename Number>
   static void
   estimate(
     const DoFHandler<dim, spacedim> &dof,
     const hp::QCollection<dim - 1> & quadrature,
-    const std::map<types::boundary_id,
-                   const Function<spacedim, typename InputVector::value_type> *>
+    const std::map<types::boundary_id, const Function<spacedim, Number> *>
       &                       neumann_bc,
-    const InputVector &       solution,
+    const ReadVector<Number> &solution,
     Vector<float> &           error,
     const ComponentMask &     component_mask = ComponentMask(),
     const Function<spacedim> *coefficients   = nullptr,
@@ -477,45 +471,43 @@ public:
    * Equivalent to the set of functions above, except that this one takes a
    * quadrature collection for hp-finite element dof handlers.
    */
-  template <typename InputVector>
+  template <typename Number>
   static void
   estimate(
     const Mapping<dim, spacedim> &   mapping,
     const DoFHandler<dim, spacedim> &dof,
     const hp::QCollection<dim - 1> & quadrature,
-    const std::map<types::boundary_id,
-                   const Function<spacedim, typename InputVector::value_type> *>
-      &                                     neumann_bc,
-    const std::vector<const InputVector *> &solutions,
-    std::vector<Vector<float> *> &          errors,
-    const ComponentMask &                   component_mask = ComponentMask(),
-    const Function<spacedim> *              coefficients   = nullptr,
-    const unsigned int        n_threads    = numbers::invalid_unsigned_int,
-    const types::subdomain_id subdomain_id = numbers::invalid_subdomain_id,
-    const types::material_id  material_id  = numbers::invalid_material_id,
-    const Strategy            strategy     = cell_diameter_over_24);
+    const std::map<types::boundary_id, const Function<spacedim, Number> *>
+      &                                            neumann_bc,
+    const std::vector<const ReadVector<Number> *> &solutions,
+    std::vector<Vector<float> *> &                 errors,
+    const ComponentMask &     component_mask = ComponentMask(),
+    const Function<spacedim> *coefficients   = nullptr,
+    const unsigned int        n_threads      = numbers::invalid_unsigned_int,
+    const types::subdomain_id subdomain_id   = numbers::invalid_subdomain_id,
+    const types::material_id  material_id    = numbers::invalid_material_id,
+    const Strategy            strategy       = cell_diameter_over_24);
 
 
   /**
    * Equivalent to the set of functions above, except that this one takes a
    * quadrature collection for hp-finite element dof handlers.
    */
-  template <typename InputVector>
+  template <typename Number>
   static void
   estimate(
     const DoFHandler<dim, spacedim> &dof,
     const hp::QCollection<dim - 1> & quadrature,
-    const std::map<types::boundary_id,
-                   const Function<spacedim, typename InputVector::value_type> *>
-      &                                     neumann_bc,
-    const std::vector<const InputVector *> &solutions,
-    std::vector<Vector<float> *> &          errors,
-    const ComponentMask &                   component_mask = ComponentMask(),
-    const Function<spacedim> *              coefficients   = nullptr,
-    const unsigned int        n_threads    = numbers::invalid_unsigned_int,
-    const types::subdomain_id subdomain_id = numbers::invalid_subdomain_id,
-    const types::material_id  material_id  = numbers::invalid_material_id,
-    const Strategy            strategy     = cell_diameter_over_24);
+    const std::map<types::boundary_id, const Function<spacedim, Number> *>
+      &                                            neumann_bc,
+    const std::vector<const ReadVector<Number> *> &solutions,
+    std::vector<Vector<float> *> &                 errors,
+    const ComponentMask &     component_mask = ComponentMask(),
+    const Function<spacedim> *coefficients   = nullptr,
+    const unsigned int        n_threads      = numbers::invalid_unsigned_int,
+    const types::subdomain_id subdomain_id   = numbers::invalid_subdomain_id,
+    const types::material_id  material_id    = numbers::invalid_material_id,
+    const Strategy            strategy       = cell_diameter_over_24);
 
   /**
    * Exception
@@ -624,16 +616,15 @@ public:
    * respective parameter for compatibility with the function signature in the
    * general case.
    */
-  template <typename InputVector>
+  template <typename Number>
   static void
   estimate(
     const Mapping<1, spacedim> &   mapping,
     const DoFHandler<1, spacedim> &dof,
     const Quadrature<0> &          quadrature,
-    const std::map<types::boundary_id,
-                   const Function<spacedim, typename InputVector::value_type> *>
+    const std::map<types::boundary_id, const Function<spacedim, Number> *>
       &                       neumann_bc,
-    const InputVector &       solution,
+    const ReadVector<Number> &solution,
     Vector<float> &           error,
     const ComponentMask &     component_mask = ComponentMask(),
     const Function<spacedim> *coefficient    = nullptr,
@@ -648,15 +639,14 @@ public:
    * Call the @p estimate function, see above, with
    * <tt>mapping=MappingQ1<1>()</tt>.
    */
-  template <typename InputVector>
+  template <typename Number>
   static void
   estimate(
     const DoFHandler<1, spacedim> &dof,
     const Quadrature<0> &          quadrature,
-    const std::map<types::boundary_id,
-                   const Function<spacedim, typename InputVector::value_type> *>
+    const std::map<types::boundary_id, const Function<spacedim, Number> *>
       &                       neumann_bc,
-    const InputVector &       solution,
+    const ReadVector<Number> &solution,
     Vector<float> &           error,
     const ComponentMask &     component_mask = ComponentMask(),
     const Function<spacedim> *coefficients   = nullptr,
@@ -680,23 +670,22 @@ public:
    * construct of vector of references, so we had to use a vector of
    * pointers.)
    */
-  template <typename InputVector>
+  template <typename Number>
   static void
   estimate(
     const Mapping<1, spacedim> &   mapping,
     const DoFHandler<1, spacedim> &dof,
     const Quadrature<0> &          quadrature,
-    const std::map<types::boundary_id,
-                   const Function<spacedim, typename InputVector::value_type> *>
-      &                                     neumann_bc,
-    const std::vector<const InputVector *> &solutions,
-    std::vector<Vector<float> *> &          errors,
-    const ComponentMask &                   component_mask = ComponentMask(),
-    const Function<spacedim> *              coefficients   = nullptr,
-    const unsigned int        n_threads    = numbers::invalid_unsigned_int,
-    const types::subdomain_id subdomain_id = numbers::invalid_subdomain_id,
-    const types::material_id  material_id  = numbers::invalid_material_id,
-    const Strategy            strategy     = cell_diameter_over_24);
+    const std::map<types::boundary_id, const Function<spacedim, Number> *>
+      &                                            neumann_bc,
+    const std::vector<const ReadVector<Number> *> &solutions,
+    std::vector<Vector<float> *> &                 errors,
+    const ComponentMask &     component_mask = ComponentMask(),
+    const Function<spacedim> *coefficients   = nullptr,
+    const unsigned int        n_threads      = numbers::invalid_unsigned_int,
+    const types::subdomain_id subdomain_id   = numbers::invalid_subdomain_id,
+    const types::material_id  material_id    = numbers::invalid_material_id,
+    const Strategy            strategy       = cell_diameter_over_24);
 
 
 
@@ -704,22 +693,21 @@ public:
    * Call the @p estimate function, see above, with
    * <tt>mapping=MappingQ1<1>()</tt>.
    */
-  template <typename InputVector>
+  template <typename Number>
   static void
   estimate(
     const DoFHandler<1, spacedim> &dof,
     const Quadrature<0> &          quadrature,
-    const std::map<types::boundary_id,
-                   const Function<spacedim, typename InputVector::value_type> *>
-      &                                     neumann_bc,
-    const std::vector<const InputVector *> &solutions,
-    std::vector<Vector<float> *> &          errors,
-    const ComponentMask &                   component_mask = ComponentMask(),
-    const Function<spacedim> *              coefficients   = nullptr,
-    const unsigned int        n_threads    = numbers::invalid_unsigned_int,
-    const types::subdomain_id subdomain_id = numbers::invalid_subdomain_id,
-    const types::material_id  material_id  = numbers::invalid_material_id,
-    const Strategy            strategy     = cell_diameter_over_24);
+    const std::map<types::boundary_id, const Function<spacedim, Number> *>
+      &                                            neumann_bc,
+    const std::vector<const ReadVector<Number> *> &solutions,
+    std::vector<Vector<float> *> &                 errors,
+    const ComponentMask &     component_mask = ComponentMask(),
+    const Function<spacedim> *coefficients   = nullptr,
+    const unsigned int        n_threads      = numbers::invalid_unsigned_int,
+    const types::subdomain_id subdomain_id   = numbers::invalid_subdomain_id,
+    const types::material_id  material_id    = numbers::invalid_material_id,
+    const Strategy            strategy       = cell_diameter_over_24);
 
 
 
@@ -727,16 +715,15 @@ public:
    * Equivalent to the set of functions above, except that this one takes a
    * quadrature collection for hp-finite element dof handlers.
    */
-  template <typename InputVector>
+  template <typename Number>
   static void
   estimate(
     const Mapping<1, spacedim> &   mapping,
     const DoFHandler<1, spacedim> &dof,
     const hp::QCollection<0> &     quadrature,
-    const std::map<types::boundary_id,
-                   const Function<spacedim, typename InputVector::value_type> *>
+    const std::map<types::boundary_id, const Function<spacedim, Number> *>
       &                       neumann_bc,
-    const InputVector &       solution,
+    const ReadVector<Number> &solution,
     Vector<float> &           error,
     const ComponentMask &     component_mask = ComponentMask(),
     const Function<spacedim> *coefficients   = nullptr,
@@ -751,15 +738,14 @@ public:
    * Equivalent to the set of functions above, except that this one takes a
    * quadrature collection for hp-finite element dof handlers.
    */
-  template <typename InputVector>
+  template <typename Number>
   static void
   estimate(
     const DoFHandler<1, spacedim> &dof,
     const hp::QCollection<0> &     quadrature,
-    const std::map<types::boundary_id,
-                   const Function<spacedim, typename InputVector::value_type> *>
+    const std::map<types::boundary_id, const Function<spacedim, Number> *>
       &                       neumann_bc,
-    const InputVector &       solution,
+    const ReadVector<Number> &solution,
     Vector<float> &           error,
     const ComponentMask &     component_mask = ComponentMask(),
     const Function<spacedim> *coefficients   = nullptr,
@@ -774,23 +760,22 @@ public:
    * Equivalent to the set of functions above, except that this one takes a
    * quadrature collection for hp-finite element dof handlers.
    */
-  template <typename InputVector>
+  template <typename Number>
   static void
   estimate(
     const Mapping<1, spacedim> &   mapping,
     const DoFHandler<1, spacedim> &dof,
     const hp::QCollection<0> &     quadrature,
-    const std::map<types::boundary_id,
-                   const Function<spacedim, typename InputVector::value_type> *>
-      &                                     neumann_bc,
-    const std::vector<const InputVector *> &solutions,
-    std::vector<Vector<float> *> &          errors,
-    const ComponentMask &                   component_mask = ComponentMask(),
-    const Function<spacedim> *              coefficients   = nullptr,
-    const unsigned int        n_threads    = numbers::invalid_unsigned_int,
-    const types::subdomain_id subdomain_id = numbers::invalid_subdomain_id,
-    const types::material_id  material_id  = numbers::invalid_material_id,
-    const Strategy            strategy     = cell_diameter_over_24);
+    const std::map<types::boundary_id, const Function<spacedim, Number> *>
+      &                                            neumann_bc,
+    const std::vector<const ReadVector<Number> *> &solutions,
+    std::vector<Vector<float> *> &                 errors,
+    const ComponentMask &     component_mask = ComponentMask(),
+    const Function<spacedim> *coefficients   = nullptr,
+    const unsigned int        n_threads      = numbers::invalid_unsigned_int,
+    const types::subdomain_id subdomain_id   = numbers::invalid_subdomain_id,
+    const types::material_id  material_id    = numbers::invalid_material_id,
+    const Strategy            strategy       = cell_diameter_over_24);
 
 
 
@@ -798,22 +783,21 @@ public:
    * Equivalent to the set of functions above, except that this one takes a
    * quadrature collection for hp-finite element dof handlers.
    */
-  template <typename InputVector>
+  template <typename Number>
   static void
   estimate(
     const DoFHandler<1, spacedim> &dof,
     const hp::QCollection<0> &     quadrature,
-    const std::map<types::boundary_id,
-                   const Function<spacedim, typename InputVector::value_type> *>
-      &                                     neumann_bc,
-    const std::vector<const InputVector *> &solutions,
-    std::vector<Vector<float> *> &          errors,
-    const ComponentMask &                   component_mask = ComponentMask(),
-    const Function<spacedim> *              coefficients   = nullptr,
-    const unsigned int        n_threads    = numbers::invalid_unsigned_int,
-    const types::subdomain_id subdomain_id = numbers::invalid_subdomain_id,
-    const types::material_id  material_id  = numbers::invalid_material_id,
-    const Strategy            strategy     = cell_diameter_over_24);
+    const std::map<types::boundary_id, const Function<spacedim, Number> *>
+      &                                            neumann_bc,
+    const std::vector<const ReadVector<Number> *> &solutions,
+    std::vector<Vector<float> *> &                 errors,
+    const ComponentMask &     component_mask = ComponentMask(),
+    const Function<spacedim> *coefficients   = nullptr,
+    const unsigned int        n_threads      = numbers::invalid_unsigned_int,
+    const types::subdomain_id subdomain_id   = numbers::invalid_subdomain_id,
+    const types::material_id  material_id    = numbers::invalid_material_id,
+    const Strategy            strategy       = cell_diameter_over_24);
 
 
 
index 13594abf089d87dd812d2454dc993b6d11142e9c..7a059b6e7372c2b162a3ad1e5edb1e77094c0dce 100644 (file)
@@ -652,14 +652,13 @@ namespace internal
    * boundary), or the other side's refinement level is the same as that of
    * this side, then handle the integration of these both cases together.
    */
-  template <typename InputVector, int dim, int spacedim>
+  template <typename Number, int dim, int spacedim>
   void
   integrate_over_regular_face(
-    const std::vector<const InputVector *> &solutions,
-    ParallelData<dim, spacedim, typename InputVector::value_type>
-      &                            parallel_data,
+    const std::vector<const ReadVector<Number> *> &solutions,
+    ParallelData<dim, spacedim, Number> &          parallel_data,
     std::map<typename DoFHandler<dim, spacedim>::face_iterator,
-             std::vector<double>> &local_face_integrals,
+             std::vector<double>> &                local_face_integrals,
     const typename DoFHandler<dim, spacedim>::active_cell_iterator &cell,
     const unsigned int                                              face_no,
     dealii::hp::FEFaceValues<dim, spacedim> &fe_face_values_cell,
@@ -746,14 +745,13 @@ namespace internal
    * over face @p face_no of @p cell, where the respective neighbor is
    * refined, so that the integration is a bit more complex.
    */
-  template <typename InputVector, int dim, int spacedim>
+  template <typename Number, int dim, int spacedim>
   void
   integrate_over_irregular_face(
-    const std::vector<const InputVector *> &solutions,
-    ParallelData<dim, spacedim, typename InputVector::value_type>
-      &                            parallel_data,
+    const std::vector<const ReadVector<Number> *> &solutions,
+    ParallelData<dim, spacedim, Number> &          parallel_data,
     std::map<typename DoFHandler<dim, spacedim>::face_iterator,
-             std::vector<double>> &local_face_integrals,
+             std::vector<double>> &                local_face_integrals,
     const typename DoFHandler<dim, spacedim>::active_cell_iterator &cell,
     const unsigned int                                              face_no,
     dealii::hp::FEFaceValues<dim, spacedim> &   fe_face_values,
@@ -861,15 +859,14 @@ namespace internal
    * This function is only needed in two or three dimensions.  The error
    * estimator in one dimension is implemented separately.
    */
-  template <typename InputVector, int dim, int spacedim>
+  template <typename Number, int dim, int spacedim>
   void
   estimate_one_cell(
     const typename DoFHandler<dim, spacedim>::active_cell_iterator &cell,
-    ParallelData<dim, spacedim, typename InputVector::value_type>
-      &                                     parallel_data,
+    ParallelData<dim, spacedim, Number> &          parallel_data,
     std::map<typename DoFHandler<dim, spacedim>::face_iterator,
-             std::vector<double>> &         local_face_integrals,
-    const std::vector<const InputVector *> &solutions,
+             std::vector<double>> &                local_face_integrals,
+    const std::vector<const ReadVector<Number> *> &solutions,
     const typename KellyErrorEstimator<dim, spacedim>::Strategy strategy)
   {
     const unsigned int n_solution_vectors = solutions.size();
@@ -1001,16 +998,15 @@ namespace internal
 // the following function is still independent of dimension, but it
 // calls dimension dependent functions
 template <int dim, int spacedim>
-template <typename InputVector>
+template <typename Number>
 void
 KellyErrorEstimator<dim, spacedim>::estimate(
   const Mapping<dim, spacedim> &   mapping,
   const DoFHandler<dim, spacedim> &dof_handler,
   const Quadrature<dim - 1> &      quadrature,
-  const std::map<types::boundary_id,
-                 const Function<spacedim, typename InputVector::value_type> *>
+  const std::map<types::boundary_id, const Function<spacedim, Number> *>
     &                       neumann_bc,
-  const InputVector &       solution,
+  const ReadVector<Number> &solution,
   Vector<float> &           error,
   const ComponentMask &     component_mask,
   const Function<spacedim> *coefficients,
@@ -1020,8 +1016,8 @@ KellyErrorEstimator<dim, spacedim>::estimate(
   const Strategy            strategy)
 {
   // just pass on to the other function
-  const std::vector<const InputVector *> solutions(1, &solution);
-  std::vector<Vector<float> *>           errors(1, &error);
+  const std::vector<const ReadVector<Number> *> solutions(1, &solution);
+  std::vector<Vector<float> *>                  errors(1, &error);
   estimate(mapping,
            dof_handler,
            quadrature,
@@ -1038,15 +1034,14 @@ KellyErrorEstimator<dim, spacedim>::estimate(
 
 
 template <int dim, int spacedim>
-template <typename InputVector>
+template <typename Number>
 void
 KellyErrorEstimator<dim, spacedim>::estimate(
   const DoFHandler<dim, spacedim> &dof_handler,
   const Quadrature<dim - 1> &      quadrature,
-  const std::map<types::boundary_id,
-                 const Function<spacedim, typename InputVector::value_type> *>
+  const std::map<types::boundary_id, const Function<spacedim, Number> *>
     &                       neumann_bc,
-  const InputVector &       solution,
+  const ReadVector<Number> &solution,
   Vector<float> &           error,
   const ComponentMask &     component_mask,
   const Function<spacedim> *coefficients,
@@ -1071,16 +1066,15 @@ KellyErrorEstimator<dim, spacedim>::estimate(
 
 
 template <int dim, int spacedim>
-template <typename InputVector>
+template <typename Number>
 void
 KellyErrorEstimator<dim, spacedim>::estimate(
   const Mapping<dim, spacedim> &   mapping,
   const DoFHandler<dim, spacedim> &dof_handler,
   const hp::QCollection<dim - 1> & quadrature,
-  const std::map<types::boundary_id,
-                 const Function<spacedim, typename InputVector::value_type> *>
+  const std::map<types::boundary_id, const Function<spacedim, Number> *>
     &                       neumann_bc,
-  const InputVector &       solution,
+  const ReadVector<Number> &solution,
   Vector<float> &           error,
   const ComponentMask &     component_mask,
   const Function<spacedim> *coefficients,
@@ -1090,8 +1084,8 @@ KellyErrorEstimator<dim, spacedim>::estimate(
   const Strategy            strategy)
 {
   // just pass on to the other function
-  const std::vector<const InputVector *> solutions(1, &solution);
-  std::vector<Vector<float> *>           errors(1, &error);
+  const std::vector<const ReadVector<Number> *> solutions(1, &solution);
+  std::vector<Vector<float> *>                  errors(1, &error);
   estimate(mapping,
            dof_handler,
            quadrature,
@@ -1108,15 +1102,14 @@ KellyErrorEstimator<dim, spacedim>::estimate(
 
 
 template <int dim, int spacedim>
-template <typename InputVector>
+template <typename Number>
 void
 KellyErrorEstimator<dim, spacedim>::estimate(
   const DoFHandler<dim, spacedim> &dof_handler,
   const hp::QCollection<dim - 1> & quadrature,
-  const std::map<types::boundary_id,
-                 const Function<spacedim, typename InputVector::value_type> *>
+  const std::map<types::boundary_id, const Function<spacedim, Number> *>
     &                       neumann_bc,
-  const InputVector &       solution,
+  const ReadVector<Number> &solution,
   Vector<float> &           error,
   const ComponentMask &     component_mask,
   const Function<spacedim> *coefficients,
@@ -1142,19 +1135,18 @@ KellyErrorEstimator<dim, spacedim>::estimate(
 
 
 template <int dim, int spacedim>
-template <typename InputVector>
+template <typename Number>
 void
 KellyErrorEstimator<dim, spacedim>::estimate(
   const Mapping<dim, spacedim> &   mapping,
   const DoFHandler<dim, spacedim> &dof_handler,
   const hp::QCollection<dim - 1> & face_quadratures,
-  const std::map<types::boundary_id,
-                 const Function<spacedim, typename InputVector::value_type> *>
-    &                                     neumann_bc,
-  const std::vector<const InputVector *> &solutions,
-  std::vector<Vector<float> *> &          errors,
-  const ComponentMask &                   component_mask,
-  const Function<spacedim> *              coefficients,
+  const std::map<types::boundary_id, const Function<spacedim, Number> *>
+    &                                            neumann_bc,
+  const std::vector<const ReadVector<Number> *> &solutions,
+  std::vector<Vector<float> *> &                 errors,
+  const ComponentMask &                          component_mask,
+  const Function<spacedim> *                     coefficients,
   const unsigned int,
   const types::subdomain_id subdomain_id_,
   const types::material_id  material_id,
@@ -1222,17 +1214,17 @@ KellyErrorEstimator<dim, spacedim>::estimate(
   // all the data needed in the error estimator by each of the threads is
   // gathered in the following structures
   const hp::MappingCollection<dim, spacedim> mapping_collection(mapping);
-  const internal::ParallelData<dim, spacedim, typename InputVector::value_type>
-    parallel_data(dof_handler.get_fe_collection(),
-                  face_quadratures,
-                  mapping_collection,
-                  (!neumann_bc.empty() || (coefficients != nullptr)),
-                  solutions.size(),
-                  subdomain_id,
-                  material_id,
-                  &neumann_bc,
-                  component_mask,
-                  coefficients);
+  const internal::ParallelData<dim, spacedim, Number> parallel_data(
+    dof_handler.get_fe_collection(),
+    face_quadratures,
+    mapping_collection,
+    (!neumann_bc.empty() || (coefficients != nullptr)),
+    solutions.size(),
+    subdomain_id,
+    material_id,
+    &neumann_bc,
+    component_mask,
+    coefficients);
   std::map<typename DoFHandler<dim, spacedim>::face_iterator,
            std::vector<double>>
     sample_local_face_integrals;
@@ -1244,10 +1236,9 @@ KellyErrorEstimator<dim, spacedim>::estimate(
       dof_handler.end()),
     [&solutions, strategy](
       const typename DoFHandler<dim, spacedim>::active_cell_iterator &cell,
-      internal::ParallelData<dim, spacedim, typename InputVector::value_type>
-        &                            parallel_data,
+      internal::ParallelData<dim, spacedim, Number> &parallel_data,
       std::map<typename DoFHandler<dim, spacedim>::face_iterator,
-               std::vector<double>> &local_face_integrals) {
+               std::vector<double>> &                local_face_integrals) {
       internal::estimate_one_cell(
         cell, parallel_data, local_face_integrals, solutions, strategy);
     },
@@ -1311,23 +1302,22 @@ KellyErrorEstimator<dim, spacedim>::estimate(
 
 
 template <int dim, int spacedim>
-template <typename InputVector>
+template <typename Number>
 void
 KellyErrorEstimator<dim, spacedim>::estimate(
   const Mapping<dim, spacedim> &   mapping,
   const DoFHandler<dim, spacedim> &dof_handler,
   const Quadrature<dim - 1> &      quadrature,
-  const std::map<types::boundary_id,
-                 const Function<spacedim, typename InputVector::value_type> *>
-    &                                     neumann_bc,
-  const std::vector<const InputVector *> &solutions,
-  std::vector<Vector<float> *> &          errors,
-  const ComponentMask &                   component_mask,
-  const Function<spacedim> *              coefficients,
-  const unsigned int                      n_threads,
-  const types::subdomain_id               subdomain_id,
-  const types::material_id                material_id,
-  const Strategy                          strategy)
+  const std::map<types::boundary_id, const Function<spacedim, Number> *>
+    &                                            neumann_bc,
+  const std::vector<const ReadVector<Number> *> &solutions,
+  std::vector<Vector<float> *> &                 errors,
+  const ComponentMask &                          component_mask,
+  const Function<spacedim> *                     coefficients,
+  const unsigned int                             n_threads,
+  const types::subdomain_id                      subdomain_id,
+  const types::material_id                       material_id,
+  const Strategy                                 strategy)
 {
   // forward to the function with the QCollection
   estimate(mapping,
@@ -1346,22 +1336,21 @@ KellyErrorEstimator<dim, spacedim>::estimate(
 
 
 template <int dim, int spacedim>
-template <typename InputVector>
+template <typename Number>
 void
 KellyErrorEstimator<dim, spacedim>::estimate(
   const DoFHandler<dim, spacedim> &dof_handler,
   const Quadrature<dim - 1> &      quadrature,
-  const std::map<types::boundary_id,
-                 const Function<spacedim, typename InputVector::value_type> *>
-    &                                     neumann_bc,
-  const std::vector<const InputVector *> &solutions,
-  std::vector<Vector<float> *> &          errors,
-  const ComponentMask &                   component_mask,
-  const Function<spacedim> *              coefficients,
-  const unsigned int                      n_threads,
-  const types::subdomain_id               subdomain_id,
-  const types::material_id                material_id,
-  const Strategy                          strategy)
+  const std::map<types::boundary_id, const Function<spacedim, Number> *>
+    &                                            neumann_bc,
+  const std::vector<const ReadVector<Number> *> &solutions,
+  std::vector<Vector<float> *> &                 errors,
+  const ComponentMask &                          component_mask,
+  const Function<spacedim> *                     coefficients,
+  const unsigned int                             n_threads,
+  const types::subdomain_id                      subdomain_id,
+  const types::material_id                       material_id,
+  const Strategy                                 strategy)
 {
   estimate(get_default_linear_mapping(dof_handler.get_triangulation()),
            dof_handler,
@@ -1380,22 +1369,21 @@ KellyErrorEstimator<dim, spacedim>::estimate(
 
 
 template <int dim, int spacedim>
-template <typename InputVector>
+template <typename Number>
 void
 KellyErrorEstimator<dim, spacedim>::estimate(
   const DoFHandler<dim, spacedim> &dof_handler,
   const hp::QCollection<dim - 1> & quadrature,
-  const std::map<types::boundary_id,
-                 const Function<spacedim, typename InputVector::value_type> *>
-    &                                     neumann_bc,
-  const std::vector<const InputVector *> &solutions,
-  std::vector<Vector<float> *> &          errors,
-  const ComponentMask &                   component_mask,
-  const Function<spacedim> *              coefficients,
-  const unsigned int                      n_threads,
-  const types::subdomain_id               subdomain_id,
-  const types::material_id                material_id,
-  const Strategy                          strategy)
+  const std::map<types::boundary_id, const Function<spacedim, Number> *>
+    &                                            neumann_bc,
+  const std::vector<const ReadVector<Number> *> &solutions,
+  std::vector<Vector<float> *> &                 errors,
+  const ComponentMask &                          component_mask,
+  const Function<spacedim> *                     coefficients,
+  const unsigned int                             n_threads,
+  const types::subdomain_id                      subdomain_id,
+  const types::material_id                       material_id,
+  const Strategy                                 strategy)
 {
   estimate(get_default_linear_mapping(dof_handler.get_triangulation()),
            dof_handler,
index 2e8413b372c226f73038da15af8e4e1f1f879d21..211ffe29f9f93f4e819d5a5d4754cdfaf059bfee 100644 (file)
@@ -22,158 +22,142 @@ for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS)
 #endif
   }
 
-for (VEC : VECTOR_TYPES; deal_II_dimension : DIMENSIONS;
+for (S : REAL_AND_COMPLEX_SCALARS; deal_II_dimension : DIMENSIONS;
      deal_II_space_dimension : SPACE_DIMENSIONS)
   {
 #if deal_II_dimension != 1 && deal_II_dimension <= deal_II_space_dimension
 
     template void
     KellyErrorEstimator<deal_II_dimension, deal_II_space_dimension>::estimate<
-      VEC>(
-      const Mapping<deal_II_dimension, deal_II_space_dimension> &,
-      const DoFHandler<deal_II_dimension, deal_II_space_dimension> &,
-      const Quadrature<deal_II_dimension - 1> &,
-      const std::map<types::boundary_id,
-                     const Function<deal_II_space_dimension, VEC::value_type> *>
-        &,
-      const VEC &,
-      Vector<float> &,
-      const ComponentMask &,
-      const Function<deal_II_space_dimension> *,
-      const unsigned int,
-      const types::subdomain_id,
-      const types::material_id,
-      const KellyErrorEstimator<deal_II_dimension,
-                                deal_II_space_dimension>::Strategy);
+      S>(const Mapping<deal_II_dimension, deal_II_space_dimension> &,
+         const DoFHandler<deal_II_dimension, deal_II_space_dimension> &,
+         const Quadrature<deal_II_dimension - 1> &,
+         const std::map<types::boundary_id,
+                        const Function<deal_II_space_dimension, S> *> &,
+         const ReadVector<S> &,
+         Vector<float> &,
+         const ComponentMask &,
+         const Function<deal_II_space_dimension> *,
+         const unsigned int,
+         const types::subdomain_id,
+         const types::material_id,
+         const KellyErrorEstimator<deal_II_dimension,
+                                   deal_II_space_dimension>::Strategy);
 
     template void
     KellyErrorEstimator<deal_II_dimension, deal_II_space_dimension>::estimate<
-      VEC>(
-      const DoFHandler<deal_II_dimension, deal_II_space_dimension> &,
-      const Quadrature<deal_II_dimension - 1> &,
-      const std::map<types::boundary_id,
-                     const Function<deal_II_space_dimension, VEC::value_type> *>
-        &,
-      const VEC &,
-      Vector<float> &,
-      const ComponentMask &,
-      const Function<deal_II_space_dimension> *,
-      const unsigned int,
-      const types::subdomain_id,
-      const types::material_id,
-      const KellyErrorEstimator<deal_II_dimension,
-                                deal_II_space_dimension>::Strategy);
+      S>(const DoFHandler<deal_II_dimension, deal_II_space_dimension> &,
+         const Quadrature<deal_II_dimension - 1> &,
+         const std::map<types::boundary_id,
+                        const Function<deal_II_space_dimension, S> *> &,
+         const ReadVector<S> &,
+         Vector<float> &,
+         const ComponentMask &,
+         const Function<deal_II_space_dimension> *,
+         const unsigned int,
+         const types::subdomain_id,
+         const types::material_id,
+         const KellyErrorEstimator<deal_II_dimension,
+                                   deal_II_space_dimension>::Strategy);
 
     template void
     KellyErrorEstimator<deal_II_dimension, deal_II_space_dimension>::estimate<
-      VEC>(
-      const Mapping<deal_II_dimension, deal_II_space_dimension> &,
-      const DoFHandler<deal_II_dimension, deal_II_space_dimension> &,
-      const Quadrature<deal_II_dimension - 1> &,
-      const std::map<types::boundary_id,
-                     const Function<deal_II_space_dimension, VEC::value_type> *>
-        &,
-      const std::vector<const VEC *> &,
-      std::vector<Vector<float> *> &,
-      const ComponentMask &,
-      const Function<deal_II_space_dimension> *,
-      const unsigned int,
-      const types::subdomain_id,
-      const types::material_id,
-      const KellyErrorEstimator<deal_II_dimension,
-                                deal_II_space_dimension>::Strategy);
+      S>(const Mapping<deal_II_dimension, deal_II_space_dimension> &,
+         const DoFHandler<deal_II_dimension, deal_II_space_dimension> &,
+         const Quadrature<deal_II_dimension - 1> &,
+         const std::map<types::boundary_id,
+                        const Function<deal_II_space_dimension, S> *> &,
+         const std::vector<const ReadVector<S> *> &,
+         std::vector<Vector<float> *> &,
+         const ComponentMask &,
+         const Function<deal_II_space_dimension> *,
+         const unsigned int,
+         const types::subdomain_id,
+         const types::material_id,
+         const KellyErrorEstimator<deal_II_dimension,
+                                   deal_II_space_dimension>::Strategy);
 
     template void
     KellyErrorEstimator<deal_II_dimension, deal_II_space_dimension>::estimate<
-      VEC>(
-      const DoFHandler<deal_II_dimension, deal_II_space_dimension> &,
-      const Quadrature<deal_II_dimension - 1> &,
-      const std::map<types::boundary_id,
-                     const Function<deal_II_space_dimension, VEC::value_type> *>
-        &,
-      const std::vector<const VEC *> &,
-      std::vector<Vector<float> *> &,
-      const ComponentMask &,
-      const Function<deal_II_space_dimension> *,
-      const unsigned int,
-      const types::subdomain_id,
-      const types::material_id,
-      const KellyErrorEstimator<deal_II_dimension,
-                                deal_II_space_dimension>::Strategy);
+      S>(const DoFHandler<deal_II_dimension, deal_II_space_dimension> &,
+         const Quadrature<deal_II_dimension - 1> &,
+         const std::map<types::boundary_id,
+                        const Function<deal_II_space_dimension, S> *> &,
+         const std::vector<const ReadVector<S> *> &,
+         std::vector<Vector<float> *> &,
+         const ComponentMask &,
+         const Function<deal_II_space_dimension> *,
+         const unsigned int,
+         const types::subdomain_id,
+         const types::material_id,
+         const KellyErrorEstimator<deal_II_dimension,
+                                   deal_II_space_dimension>::Strategy);
 
     template void
     KellyErrorEstimator<deal_II_dimension, deal_II_space_dimension>::estimate<
-      VEC>(
-      const Mapping<deal_II_dimension, deal_II_space_dimension> &,
-      const DoFHandler<deal_II_dimension, deal_II_space_dimension> &,
-      const hp::QCollection<deal_II_dimension - 1> &,
-      const std::map<types::boundary_id,
-                     const Function<deal_II_space_dimension, VEC::value_type> *>
-        &,
-      const VEC &,
-      Vector<float> &,
-      const ComponentMask &,
-      const Function<deal_II_space_dimension> *,
-      const unsigned int,
-      const types::subdomain_id,
-      const types::material_id,
-      const KellyErrorEstimator<deal_II_dimension,
-                                deal_II_space_dimension>::Strategy);
+      S>(const Mapping<deal_II_dimension, deal_II_space_dimension> &,
+         const DoFHandler<deal_II_dimension, deal_II_space_dimension> &,
+         const hp::QCollection<deal_II_dimension - 1> &,
+         const std::map<types::boundary_id,
+                        const Function<deal_II_space_dimension, S> *> &,
+         const ReadVector<S> &,
+         Vector<float> &,
+         const ComponentMask &,
+         const Function<deal_II_space_dimension> *,
+         const unsigned int,
+         const types::subdomain_id,
+         const types::material_id,
+         const KellyErrorEstimator<deal_II_dimension,
+                                   deal_II_space_dimension>::Strategy);
 
     template void
     KellyErrorEstimator<deal_II_dimension, deal_II_space_dimension>::estimate<
-      VEC>(
-      const DoFHandler<deal_II_dimension, deal_II_space_dimension> &,
-      const hp::QCollection<deal_II_dimension - 1> &,
-      const std::map<types::boundary_id,
-                     const Function<deal_II_space_dimension, VEC::value_type> *>
-        &,
-      const VEC &,
-      Vector<float> &,
-      const ComponentMask &,
-      const Function<deal_II_space_dimension> *,
-      const unsigned int,
-      const types::subdomain_id,
-      const types::material_id,
-      const KellyErrorEstimator<deal_II_dimension,
-                                deal_II_space_dimension>::Strategy);
+      S>(const DoFHandler<deal_II_dimension, deal_II_space_dimension> &,
+         const hp::QCollection<deal_II_dimension - 1> &,
+         const std::map<types::boundary_id,
+                        const Function<deal_II_space_dimension, S> *> &,
+         const ReadVector<S> &,
+         Vector<float> &,
+         const ComponentMask &,
+         const Function<deal_II_space_dimension> *,
+         const unsigned int,
+         const types::subdomain_id,
+         const types::material_id,
+         const KellyErrorEstimator<deal_II_dimension,
+                                   deal_II_space_dimension>::Strategy);
 
     template void
     KellyErrorEstimator<deal_II_dimension, deal_II_space_dimension>::estimate<
-      VEC>(
-      const Mapping<deal_II_dimension, deal_II_space_dimension> &,
-      const DoFHandler<deal_II_dimension, deal_II_space_dimension> &,
-      const hp::QCollection<deal_II_dimension - 1> &,
-      const std::map<types::boundary_id,
-                     const Function<deal_II_space_dimension, VEC::value_type> *>
-        &,
-      const std::vector<const VEC *> &,
-      std::vector<Vector<float> *> &,
-      const ComponentMask &,
-      const Function<deal_II_space_dimension> *,
-      const unsigned int,
-      const types::subdomain_id,
-      const types::material_id,
-      const KellyErrorEstimator<deal_II_dimension,
-                                deal_II_space_dimension>::Strategy);
+      S>(const Mapping<deal_II_dimension, deal_II_space_dimension> &,
+         const DoFHandler<deal_II_dimension, deal_II_space_dimension> &,
+         const hp::QCollection<deal_II_dimension - 1> &,
+         const std::map<types::boundary_id,
+                        const Function<deal_II_space_dimension, S> *> &,
+         const std::vector<const ReadVector<S> *> &,
+         std::vector<Vector<float> *> &,
+         const ComponentMask &,
+         const Function<deal_II_space_dimension> *,
+         const unsigned int,
+         const types::subdomain_id,
+         const types::material_id,
+         const KellyErrorEstimator<deal_II_dimension,
+                                   deal_II_space_dimension>::Strategy);
 
     template void
     KellyErrorEstimator<deal_II_dimension, deal_II_space_dimension>::estimate<
-      VEC>(
-      const DoFHandler<deal_II_dimension, deal_II_space_dimension> &,
-      const hp::QCollection<deal_II_dimension - 1> &,
-      const std::map<types::boundary_id,
-                     const Function<deal_II_space_dimension, VEC::value_type> *>
-        &,
-      const std::vector<const VEC *> &,
-      std::vector<Vector<float> *> &,
-      const ComponentMask &,
-      const Function<deal_II_space_dimension> *,
-      const unsigned int,
-      const types::subdomain_id,
-      const types::material_id,
-      const KellyErrorEstimator<deal_II_dimension,
-                                deal_II_space_dimension>::Strategy);
+      S>(const DoFHandler<deal_II_dimension, deal_II_space_dimension> &,
+         const hp::QCollection<deal_II_dimension - 1> &,
+         const std::map<types::boundary_id,
+                        const Function<deal_II_space_dimension, S> *> &,
+         const std::vector<const ReadVector<S> *> &,
+         std::vector<Vector<float> *> &,
+         const ComponentMask &,
+         const Function<deal_II_space_dimension> *,
+         const unsigned int,
+         const types::subdomain_id,
+         const types::material_id,
+         const KellyErrorEstimator<deal_II_dimension,
+                                   deal_II_space_dimension>::Strategy);
 
 #endif
   }
index da43a3157cb28e90506336a7af6c0d3031c5cb1d..4ad0d8302a061c56143261d965eff0e7bf47d31e 100644 (file)
@@ -56,16 +56,15 @@ DEAL_II_NAMESPACE_OPEN
 
 
 template <int spacedim>
-template <typename InputVector>
+template <typename Number>
 void
 KellyErrorEstimator<1, spacedim>::estimate(
   const Mapping<1, spacedim> &   mapping,
   const DoFHandler<1, spacedim> &dof_handler,
   const Quadrature<0> &          quadrature,
-  const std::map<types::boundary_id,
-                 const Function<spacedim, typename InputVector::value_type> *>
+  const std::map<types::boundary_id, const Function<spacedim, Number> *>
     &                       neumann_bc,
-  const InputVector &       solution,
+  const ReadVector<Number> &solution,
   Vector<float> &           error,
   const ComponentMask &     component_mask,
   const Function<spacedim> *coefficients,
@@ -75,8 +74,8 @@ KellyErrorEstimator<1, spacedim>::estimate(
   const Strategy            strategy)
 {
   // just pass on to the other function
-  const std::vector<const InputVector *> solutions(1, &solution);
-  std::vector<Vector<float> *>           errors(1, &error);
+  const std::vector<const ReadVector<Number> *> solutions(1, &solution);
+  std::vector<Vector<float> *>                  errors(1, &error);
   estimate(mapping,
            dof_handler,
            quadrature,
@@ -94,15 +93,14 @@ KellyErrorEstimator<1, spacedim>::estimate(
 
 
 template <int spacedim>
-template <typename InputVector>
+template <typename Number>
 void
 KellyErrorEstimator<1, spacedim>::estimate(
   const DoFHandler<1, spacedim> &dof_handler,
   const Quadrature<0> &          quadrature,
-  const std::map<types::boundary_id,
-                 const Function<spacedim, typename InputVector::value_type> *>
+  const std::map<types::boundary_id, const Function<spacedim, Number> *>
     &                       neumann_bc,
-  const InputVector &       solution,
+  const ReadVector<Number> &solution,
   Vector<float> &           error,
   const ComponentMask &     component_mask,
   const Function<spacedim> *coefficients,
@@ -129,22 +127,21 @@ KellyErrorEstimator<1, spacedim>::estimate(
 
 
 template <int spacedim>
-template <typename InputVector>
+template <typename Number>
 void
 KellyErrorEstimator<1, spacedim>::estimate(
   const DoFHandler<1, spacedim> &dof_handler,
   const Quadrature<0> &          quadrature,
-  const std::map<types::boundary_id,
-                 const Function<spacedim, typename InputVector::value_type> *>
-    &                                     neumann_bc,
-  const std::vector<const InputVector *> &solutions,
-  std::vector<Vector<float> *> &          errors,
-  const ComponentMask &                   component_mask,
-  const Function<spacedim> *              coefficients,
-  const unsigned int                      n_threads,
-  const types::subdomain_id               subdomain_id,
-  const types::material_id                material_id,
-  const Strategy                          strategy)
+  const std::map<types::boundary_id, const Function<spacedim, Number> *>
+    &                                            neumann_bc,
+  const std::vector<const ReadVector<Number> *> &solutions,
+  std::vector<Vector<float> *> &                 errors,
+  const ComponentMask &                          component_mask,
+  const Function<spacedim> *                     coefficients,
+  const unsigned int                             n_threads,
+  const types::subdomain_id                      subdomain_id,
+  const types::material_id                       material_id,
+  const Strategy                                 strategy)
 {
   const auto reference_cell = ReferenceCells::Line;
   estimate(reference_cell.template get_default_linear_mapping<1, spacedim>(),
@@ -164,16 +161,15 @@ KellyErrorEstimator<1, spacedim>::estimate(
 
 
 template <int spacedim>
-template <typename InputVector>
+template <typename Number>
 void
 KellyErrorEstimator<1, spacedim>::estimate(
   const Mapping<1, spacedim> &   mapping,
   const DoFHandler<1, spacedim> &dof_handler,
   const hp::QCollection<0> &     quadrature,
-  const std::map<types::boundary_id,
-                 const Function<spacedim, typename InputVector::value_type> *>
+  const std::map<types::boundary_id, const Function<spacedim, Number> *>
     &                       neumann_bc,
-  const InputVector &       solution,
+  const ReadVector<Number> &solution,
   Vector<float> &           error,
   const ComponentMask &     component_mask,
   const Function<spacedim> *coefficients,
@@ -183,8 +179,8 @@ KellyErrorEstimator<1, spacedim>::estimate(
   const Strategy            strategy)
 {
   // just pass on to the other function
-  const std::vector<const InputVector *> solutions(1, &solution);
-  std::vector<Vector<float> *>           errors(1, &error);
+  const std::vector<const ReadVector<Number> *> solutions(1, &solution);
+  std::vector<Vector<float> *>                  errors(1, &error);
   estimate(mapping,
            dof_handler,
            quadrature,
@@ -202,15 +198,14 @@ KellyErrorEstimator<1, spacedim>::estimate(
 
 
 template <int spacedim>
-template <typename InputVector>
+template <typename Number>
 void
 KellyErrorEstimator<1, spacedim>::estimate(
   const DoFHandler<1, spacedim> &dof_handler,
   const hp::QCollection<0> &     quadrature,
-  const std::map<types::boundary_id,
-                 const Function<spacedim, typename InputVector::value_type> *>
+  const std::map<types::boundary_id, const Function<spacedim, Number> *>
     &                       neumann_bc,
-  const InputVector &       solution,
+  const ReadVector<Number> &solution,
   Vector<float> &           error,
   const ComponentMask &     component_mask,
   const Function<spacedim> *coefficients,
@@ -237,22 +232,21 @@ KellyErrorEstimator<1, spacedim>::estimate(
 
 
 template <int spacedim>
-template <typename InputVector>
+template <typename Number>
 void
 KellyErrorEstimator<1, spacedim>::estimate(
   const DoFHandler<1, spacedim> &dof_handler,
   const hp::QCollection<0> &     quadrature,
-  const std::map<types::boundary_id,
-                 const Function<spacedim, typename InputVector::value_type> *>
-    &                                     neumann_bc,
-  const std::vector<const InputVector *> &solutions,
-  std::vector<Vector<float> *> &          errors,
-  const ComponentMask &                   component_mask,
-  const Function<spacedim> *              coefficients,
-  const unsigned int                      n_threads,
-  const types::subdomain_id               subdomain_id,
-  const types::material_id                material_id,
-  const Strategy                          strategy)
+  const std::map<types::boundary_id, const Function<spacedim, Number> *>
+    &                                            neumann_bc,
+  const std::vector<const ReadVector<Number> *> &solutions,
+  std::vector<Vector<float> *> &                 errors,
+  const ComponentMask &                          component_mask,
+  const Function<spacedim> *                     coefficients,
+  const unsigned int                             n_threads,
+  const types::subdomain_id                      subdomain_id,
+  const types::material_id                       material_id,
+  const Strategy                                 strategy)
 {
   const auto reference_cell = ReferenceCells::Line;
   estimate(reference_cell.template get_default_linear_mapping<1, spacedim>(),
@@ -272,26 +266,25 @@ KellyErrorEstimator<1, spacedim>::estimate(
 
 
 template <int spacedim>
-template <typename InputVector>
+template <typename Number>
 void
 KellyErrorEstimator<1, spacedim>::estimate(
   const Mapping<1, spacedim> &   mapping,
   const DoFHandler<1, spacedim> &dof_handler,
   const hp::QCollection<0> &,
-  const std::map<types::boundary_id,
-                 const Function<spacedim, typename InputVector::value_type> *>
-    &                                     neumann_bc,
-  const std::vector<const InputVector *> &solutions,
-  std::vector<Vector<float> *> &          errors,
-  const ComponentMask &                   component_mask,
-  const Function<spacedim> *              coefficient,
+  const std::map<types::boundary_id, const Function<spacedim, Number> *>
+    &                                            neumann_bc,
+  const std::vector<const ReadVector<Number> *> &solutions,
+  std::vector<Vector<float> *> &                 errors,
+  const ComponentMask &                          component_mask,
+  const Function<spacedim> *                     coefficient,
   const unsigned int,
   const types::subdomain_id subdomain_id_,
   const types::material_id  material_id,
   const Strategy            strategy)
 {
   AssertThrow(strategy == cell_diameter_over_24, ExcNotImplemented());
-  using number                     = typename InputVector::value_type;
+  using number                     = Number;
   types::subdomain_id subdomain_id = numbers::invalid_subdomain_id;
   if (const auto *triangulation = dynamic_cast<
         const parallel::DistributedTriangulationBase<1, spacedim> *>(
@@ -463,7 +456,7 @@ KellyErrorEstimator<1, spacedim>::estimate(
               {
                 if (n_components == 1)
                   {
-                    const typename InputVector::value_type v =
+                    const Number v =
                       neumann_bc.find(n)->second->value(cell->vertex(n));
 
                     for (unsigned int s = 0; s < n_solution_vectors; ++s)
@@ -471,7 +464,7 @@ KellyErrorEstimator<1, spacedim>::estimate(
                   }
                 else
                   {
-                    Vector<typename InputVector::value_type> v(n_components);
+                    Vector<Number> v(n_components);
                     neumann_bc.find(n)->second->vector_value(cell->vertex(n),
                                                              v);
 
@@ -530,23 +523,22 @@ KellyErrorEstimator<1, spacedim>::estimate(
 
 
 template <int spacedim>
-template <typename InputVector>
+template <typename Number>
 void
 KellyErrorEstimator<1, spacedim>::estimate(
   const Mapping<1, spacedim> &   mapping,
   const DoFHandler<1, spacedim> &dof_handler,
   const Quadrature<0> &          quadrature,
-  const std::map<types::boundary_id,
-                 const Function<spacedim, typename InputVector::value_type> *>
-    &                                     neumann_bc,
-  const std::vector<const InputVector *> &solutions,
-  std::vector<Vector<float> *> &          errors,
-  const ComponentMask &                   component_mask,
-  const Function<spacedim> *              coefficients,
-  const unsigned int                      n_threads,
-  const types::subdomain_id               subdomain_id,
-  const types::material_id                material_id,
-  const Strategy                          strategy)
+  const std::map<types::boundary_id, const Function<spacedim, Number> *>
+    &                                            neumann_bc,
+  const std::vector<const ReadVector<Number> *> &solutions,
+  std::vector<Vector<float> *> &                 errors,
+  const ComponentMask &                          component_mask,
+  const Function<spacedim> *                     coefficients,
+  const unsigned int                             n_threads,
+  const types::subdomain_id                      subdomain_id,
+  const types::material_id                       material_id,
+  const Strategy                                 strategy)
 {
   const hp::QCollection<0> quadrature_collection(quadrature);
   estimate(mapping,
index 23ed005479dc226003d508aac9a0f98945f0e90a..ea3f510579c09f1126f87d7ba1350e6a1ffe09f3 100644 (file)
 // ---------------------------------------------------------------------
 
 
-for (VEC : VECTOR_TYPES; deal_II_dimension : DIMENSIONS;
+for (S : REAL_AND_COMPLEX_SCALARS; deal_II_dimension : DIMENSIONS;
      deal_II_space_dimension : SPACE_DIMENSIONS)
   {
 #if deal_II_dimension == 1 && deal_II_dimension <= deal_II_space_dimension
 
     template void
     KellyErrorEstimator<deal_II_dimension, deal_II_space_dimension>::estimate<
-      VEC>(
-      const Mapping<deal_II_dimension, deal_II_space_dimension> &,
-      const DoFHandler<deal_II_dimension, deal_II_space_dimension> &,
-      const Quadrature<deal_II_dimension - 1> &,
-      const std::map<types::boundary_id,
-                     const Function<deal_II_space_dimension, VEC::value_type> *>
-        &,
-      const VEC &,
-      Vector<float> &,
-      const ComponentMask &,
-      const Function<deal_II_space_dimension> *,
-      const unsigned int,
-      const types::subdomain_id,
-      const types::material_id,
-      const Strategy);
+      S>(const Mapping<deal_II_dimension, deal_II_space_dimension> &,
+         const DoFHandler<deal_II_dimension, deal_II_space_dimension> &,
+         const Quadrature<deal_II_dimension - 1> &,
+         const std::map<types::boundary_id,
+                        const Function<deal_II_space_dimension, S> *> &,
+         const ReadVector<S> &,
+         Vector<float> &,
+         const ComponentMask &,
+         const Function<deal_II_space_dimension> *,
+         const unsigned int,
+         const types::subdomain_id,
+         const types::material_id,
+         const Strategy);
 
     template void
     KellyErrorEstimator<deal_II_dimension, deal_II_space_dimension>::estimate<
-      VEC>(
-      const DoFHandler<deal_II_dimension, deal_II_space_dimension> &,
-      const Quadrature<deal_II_dimension - 1> &,
-      const std::map<types::boundary_id,
-                     const Function<deal_II_space_dimension, VEC::value_type> *>
-        &,
-      const VEC &,
-      Vector<float> &,
-      const ComponentMask &,
-      const Function<deal_II_space_dimension> *,
-      const unsigned int,
-      const types::subdomain_id,
-      const types::material_id,
-      const Strategy);
+      S>(const DoFHandler<deal_II_dimension, deal_II_space_dimension> &,
+         const Quadrature<deal_II_dimension - 1> &,
+         const std::map<types::boundary_id,
+                        const Function<deal_II_space_dimension, S> *> &,
+         const ReadVector<S> &,
+         Vector<float> &,
+         const ComponentMask &,
+         const Function<deal_II_space_dimension> *,
+         const unsigned int,
+         const types::subdomain_id,
+         const types::material_id,
+         const Strategy);
 
     template void
     KellyErrorEstimator<deal_II_dimension, deal_II_space_dimension>::estimate<
-      VEC>(
-      const Mapping<deal_II_dimension, deal_II_space_dimension> &,
-      const DoFHandler<deal_II_dimension, deal_II_space_dimension> &,
-      const Quadrature<deal_II_dimension - 1> &,
-      const std::map<types::boundary_id,
-                     const Function<deal_II_space_dimension, VEC::value_type> *>
-        &,
-      const std::vector<const VEC *> &,
-      std::vector<Vector<float> *> &,
-      const ComponentMask &,
-      const Function<deal_II_space_dimension> *,
-      const unsigned int,
-      const types::subdomain_id,
-      const types::material_id,
-      const Strategy);
+      S>(const Mapping<deal_II_dimension, deal_II_space_dimension> &,
+         const DoFHandler<deal_II_dimension, deal_II_space_dimension> &,
+         const Quadrature<deal_II_dimension - 1> &,
+         const std::map<types::boundary_id,
+                        const Function<deal_II_space_dimension, S> *> &,
+         const std::vector<const ReadVector<S> *> &,
+         std::vector<Vector<float> *> &,
+         const ComponentMask &,
+         const Function<deal_II_space_dimension> *,
+         const unsigned int,
+         const types::subdomain_id,
+         const types::material_id,
+         const Strategy);
 
     template void
     KellyErrorEstimator<deal_II_dimension, deal_II_space_dimension>::estimate<
-      VEC>(
-      const DoFHandler<deal_II_dimension, deal_II_space_dimension> &,
-      const Quadrature<deal_II_dimension - 1> &,
-      const std::map<types::boundary_id,
-                     const Function<deal_II_space_dimension, VEC::value_type> *>
-        &,
-      const std::vector<const VEC *> &,
-      std::vector<Vector<float> *> &,
-      const ComponentMask &,
-      const Function<deal_II_space_dimension> *,
-      const unsigned int,
-      const types::subdomain_id,
-      const types::material_id,
-      const Strategy);
+      S>(const DoFHandler<deal_II_dimension, deal_II_space_dimension> &,
+         const Quadrature<deal_II_dimension - 1> &,
+         const std::map<types::boundary_id,
+                        const Function<deal_II_space_dimension, S> *> &,
+         const std::vector<const ReadVector<S> *> &,
+         std::vector<Vector<float> *> &,
+         const ComponentMask &,
+         const Function<deal_II_space_dimension> *,
+         const unsigned int,
+         const types::subdomain_id,
+         const types::material_id,
+         const Strategy);
 
     template void
     KellyErrorEstimator<deal_II_dimension, deal_II_space_dimension>::estimate<
-      VEC>(
-      const Mapping<deal_II_dimension, deal_II_space_dimension> &,
-      const DoFHandler<deal_II_dimension, deal_II_space_dimension> &,
-      const hp::QCollection<deal_II_dimension - 1> &,
-      const std::map<types::boundary_id,
-                     const Function<deal_II_space_dimension, VEC::value_type> *>
-        &,
-      const VEC &,
-      Vector<float> &,
-      const ComponentMask &,
-      const Function<deal_II_space_dimension> *,
-      const unsigned int,
-      const types::subdomain_id,
-      const types::material_id,
-      const Strategy);
+      S>(const Mapping<deal_II_dimension, deal_II_space_dimension> &,
+         const DoFHandler<deal_II_dimension, deal_II_space_dimension> &,
+         const hp::QCollection<deal_II_dimension - 1> &,
+         const std::map<types::boundary_id,
+                        const Function<deal_II_space_dimension, S> *> &,
+         const ReadVector<S> &,
+         Vector<float> &,
+         const ComponentMask &,
+         const Function<deal_II_space_dimension> *,
+         const unsigned int,
+         const types::subdomain_id,
+         const types::material_id,
+         const Strategy);
 
     template void
     KellyErrorEstimator<deal_II_dimension, deal_II_space_dimension>::estimate<
-      VEC>(
-      const DoFHandler<deal_II_dimension, deal_II_space_dimension> &,
-      const hp::QCollection<deal_II_dimension - 1> &,
-      const std::map<types::boundary_id,
-                     const Function<deal_II_space_dimension, VEC::value_type> *>
-        &,
-      const VEC &,
-      Vector<float> &,
-      const ComponentMask &,
-      const Function<deal_II_space_dimension> *,
-      const unsigned int,
-      const types::subdomain_id,
-      const types::material_id,
-      const Strategy);
+      S>(const DoFHandler<deal_II_dimension, deal_II_space_dimension> &,
+         const hp::QCollection<deal_II_dimension - 1> &,
+         const std::map<types::boundary_id,
+                        const Function<deal_II_space_dimension, S> *> &,
+         const ReadVector<S> &,
+         Vector<float> &,
+         const ComponentMask &,
+         const Function<deal_II_space_dimension> *,
+         const unsigned int,
+         const types::subdomain_id,
+         const types::material_id,
+         const Strategy);
 
     template void
     KellyErrorEstimator<deal_II_dimension, deal_II_space_dimension>::estimate<
-      VEC>(
-      const Mapping<deal_II_dimension, deal_II_space_dimension> &,
-      const DoFHandler<deal_II_dimension, deal_II_space_dimension> &,
-      const hp::QCollection<deal_II_dimension - 1> &,
-      const std::map<types::boundary_id,
-                     const Function<deal_II_space_dimension, VEC::value_type> *>
-        &,
-      const std::vector<const VEC *> &,
-      std::vector<Vector<float> *> &,
-      const ComponentMask &,
-      const Function<deal_II_space_dimension> *,
-      const unsigned int,
-      const types::subdomain_id,
-      const types::material_id,
-      const Strategy);
+      S>(const Mapping<deal_II_dimension, deal_II_space_dimension> &,
+         const DoFHandler<deal_II_dimension, deal_II_space_dimension> &,
+         const hp::QCollection<deal_II_dimension - 1> &,
+         const std::map<types::boundary_id,
+                        const Function<deal_II_space_dimension, S> *> &,
+         const std::vector<const ReadVector<S> *> &,
+         std::vector<Vector<float> *> &,
+         const ComponentMask &,
+         const Function<deal_II_space_dimension> *,
+         const unsigned int,
+         const types::subdomain_id,
+         const types::material_id,
+         const Strategy);
 
     template void
     KellyErrorEstimator<deal_II_dimension, deal_II_space_dimension>::estimate<
-      VEC>(
-      const DoFHandler<deal_II_dimension, deal_II_space_dimension> &,
-      const hp::QCollection<deal_II_dimension - 1> &,
-      const std::map<types::boundary_id,
-                     const Function<deal_II_space_dimension, VEC::value_type> *>
-        &,
-      const std::vector<const VEC *> &,
-      std::vector<Vector<float> *> &,
-      const ComponentMask &,
-      const Function<deal_II_space_dimension> *,
-      const unsigned int,
-      const types::subdomain_id,
-      const types::material_id,
-      const Strategy);
+      S>(const DoFHandler<deal_II_dimension, deal_II_space_dimension> &,
+         const hp::QCollection<deal_II_dimension - 1> &,
+         const std::map<types::boundary_id,
+                        const Function<deal_II_space_dimension, S> *> &,
+         const std::vector<const ReadVector<S> *> &,
+         std::vector<Vector<float> *> &,
+         const ComponentMask &,
+         const Function<deal_II_space_dimension> *,
+         const unsigned int,
+         const types::subdomain_id,
+         const types::material_id,
+         const Strategy);
 
 #endif
   }

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.