]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix the step-36 tests. 15588/head
authorDavid Wells <drwells@email.unc.edu>
Sun, 2 Jul 2023 15:12:07 +0000 (11:12 -0400)
committerDavid Wells <drwells@email.unc.edu>
Sun, 2 Jul 2023 15:12:07 +0000 (11:12 -0400)
These were broken by the ReadVector patch because std::vector<Derived *> cannot
be converted to std::vector<Base *>. While we are here I changed things to use
ArrayView.

doc/news/changes/incompatibilities/20230702DavidWells [new file with mode: 0644]
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
tests/fe/fe_enriched_step-36.cc
tests/fe/fe_enriched_step-36b.cc

diff --git a/doc/news/changes/incompatibilities/20230702DavidWells b/doc/news/changes/incompatibilities/20230702DavidWells
new file mode 100644 (file)
index 0000000..1c4caba
--- /dev/null
@@ -0,0 +1,6 @@
+Changed: The overloads of KellyErrorEstimator::estimate() which compute
+multiple vector error estimates at once now require that vectors be passed
+in ArrayView objects of pointers to ReadVector instead of std::vector objects
+of pointers to VectorType objects.
+<br>
+(David Wells, 2023/07/02)
index 92c67404d87d83c7fe59e02ff8495e3e46e7b9cf..5e63a7832749ca113a88d1a9ab456bb4ea48e9fe 100644 (file)
@@ -379,7 +379,7 @@ public:
    * existence of this function, see the general documentation of this class.
    *
    * Since we do not want to force the user of this function to copy around
-   * their solution vectors, the vector of solution vectors takes pointers to
+   * their solution vectors, the ArrayView of solution vectors takes pointers to
    * the solutions, rather than being a vector of vectors. This makes it
    * simpler to have the solution vectors somewhere in memory, rather than to
    * have them collected somewhere special. (Note that it is not possible to
@@ -393,9 +393,9 @@ public:
     const DoFHandler<dim, spacedim> &dof,
     const Quadrature<dim - 1> &      quadrature,
     const std::map<types::boundary_id, const Function<spacedim, Number> *>
-      &                                            neumann_bc,
-    const std::vector<const ReadVector<Number> *> &solutions,
-    std::vector<Vector<float> *> &                 errors,
+      &                                          neumann_bc,
+    const ArrayView<const ReadVector<Number> *> &solutions,
+    ArrayView<Vector<float> *> &                 errors,
     const ComponentMask &     component_mask = ComponentMask(),
     const Function<spacedim> *coefficients   = nullptr,
     const unsigned int        n_threads      = numbers::invalid_unsigned_int,
@@ -413,9 +413,9 @@ public:
     const DoFHandler<dim, spacedim> &dof,
     const Quadrature<dim - 1> &      quadrature,
     const std::map<types::boundary_id, const Function<spacedim, Number> *>
-      &                                            neumann_bc,
-    const std::vector<const ReadVector<Number> *> &solutions,
-    std::vector<Vector<float> *> &                 errors,
+      &                                          neumann_bc,
+    const ArrayView<const ReadVector<Number> *> &solutions,
+    ArrayView<Vector<float> *> &                 errors,
     const ComponentMask &     component_mask = ComponentMask(),
     const Function<spacedim> *coefficients   = nullptr,
     const unsigned int        n_threads      = numbers::invalid_unsigned_int,
@@ -478,9 +478,9 @@ public:
     const DoFHandler<dim, spacedim> &dof,
     const hp::QCollection<dim - 1> & quadrature,
     const std::map<types::boundary_id, const Function<spacedim, Number> *>
-      &                                            neumann_bc,
-    const std::vector<const ReadVector<Number> *> &solutions,
-    std::vector<Vector<float> *> &                 errors,
+      &                                          neumann_bc,
+    const ArrayView<const ReadVector<Number> *> &solutions,
+    ArrayView<Vector<float> *> &                 errors,
     const ComponentMask &     component_mask = ComponentMask(),
     const Function<spacedim> *coefficients   = nullptr,
     const unsigned int        n_threads      = numbers::invalid_unsigned_int,
@@ -499,9 +499,9 @@ public:
     const DoFHandler<dim, spacedim> &dof,
     const hp::QCollection<dim - 1> & quadrature,
     const std::map<types::boundary_id, const Function<spacedim, Number> *>
-      &                                            neumann_bc,
-    const std::vector<const ReadVector<Number> *> &solutions,
-    std::vector<Vector<float> *> &                 errors,
+      &                                          neumann_bc,
+    const ArrayView<const ReadVector<Number> *> &solutions,
+    ArrayView<Vector<float> *> &                 errors,
     const ComponentMask &     component_mask = ComponentMask(),
     const Function<spacedim> *coefficients   = nullptr,
     const unsigned int        n_threads      = numbers::invalid_unsigned_int,
@@ -677,9 +677,9 @@ public:
     const DoFHandler<1, spacedim> &dof,
     const Quadrature<0> &          quadrature,
     const std::map<types::boundary_id, const Function<spacedim, Number> *>
-      &                                            neumann_bc,
-    const std::vector<const ReadVector<Number> *> &solutions,
-    std::vector<Vector<float> *> &                 errors,
+      &                                          neumann_bc,
+    const ArrayView<const ReadVector<Number> *> &solutions,
+    ArrayView<Vector<float> *> &                 errors,
     const ComponentMask &     component_mask = ComponentMask(),
     const Function<spacedim> *coefficients   = nullptr,
     const unsigned int        n_threads      = numbers::invalid_unsigned_int,
@@ -699,9 +699,9 @@ public:
     const DoFHandler<1, spacedim> &dof,
     const Quadrature<0> &          quadrature,
     const std::map<types::boundary_id, const Function<spacedim, Number> *>
-      &                                            neumann_bc,
-    const std::vector<const ReadVector<Number> *> &solutions,
-    std::vector<Vector<float> *> &                 errors,
+      &                                          neumann_bc,
+    const ArrayView<const ReadVector<Number> *> &solutions,
+    ArrayView<Vector<float> *> &                 errors,
     const ComponentMask &     component_mask = ComponentMask(),
     const Function<spacedim> *coefficients   = nullptr,
     const unsigned int        n_threads      = numbers::invalid_unsigned_int,
@@ -767,9 +767,9 @@ public:
     const DoFHandler<1, spacedim> &dof,
     const hp::QCollection<0> &     quadrature,
     const std::map<types::boundary_id, const Function<spacedim, Number> *>
-      &                                            neumann_bc,
-    const std::vector<const ReadVector<Number> *> &solutions,
-    std::vector<Vector<float> *> &                 errors,
+      &                                          neumann_bc,
+    const ArrayView<const ReadVector<Number> *> &solutions,
+    ArrayView<Vector<float> *> &                 errors,
     const ComponentMask &     component_mask = ComponentMask(),
     const Function<spacedim> *coefficients   = nullptr,
     const unsigned int        n_threads      = numbers::invalid_unsigned_int,
@@ -789,9 +789,9 @@ public:
     const DoFHandler<1, spacedim> &dof,
     const hp::QCollection<0> &     quadrature,
     const std::map<types::boundary_id, const Function<spacedim, Number> *>
-      &                                            neumann_bc,
-    const std::vector<const ReadVector<Number> *> &solutions,
-    std::vector<Vector<float> *> &                 errors,
+      &                                          neumann_bc,
+    const ArrayView<const ReadVector<Number> *> &solutions,
+    ArrayView<Vector<float> *> &                 errors,
     const ComponentMask &     component_mask = ComponentMask(),
     const Function<spacedim> *coefficients   = nullptr,
     const unsigned int        n_threads      = numbers::invalid_unsigned_int,
index 7a059b6e7372c2b162a3ad1e5edb1e77094c0dce..5e00839ce96d784fc9452329c747908018d85220 100644 (file)
@@ -655,10 +655,10 @@ namespace internal
   template <typename Number, int dim, int spacedim>
   void
   integrate_over_regular_face(
-    const std::vector<const ReadVector<Number> *> &solutions,
-    ParallelData<dim, spacedim, Number> &          parallel_data,
+    const ArrayView<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,
@@ -748,10 +748,10 @@ namespace internal
   template <typename Number, int dim, int spacedim>
   void
   integrate_over_irregular_face(
-    const std::vector<const ReadVector<Number> *> &solutions,
-    ParallelData<dim, spacedim, Number> &          parallel_data,
+    const ArrayView<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,
@@ -863,10 +863,10 @@ namespace internal
   void
   estimate_one_cell(
     const typename DoFHandler<dim, spacedim>::active_cell_iterator &cell,
-    ParallelData<dim, spacedim, Number> &          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 ReadVector<Number> *> &solutions,
+             std::vector<double>> &              local_face_integrals,
+    const ArrayView<const ReadVector<Number> *> &solutions,
     const typename KellyErrorEstimator<dim, spacedim>::Strategy strategy)
   {
     const unsigned int n_solution_vectors = solutions.size();
@@ -1016,14 +1016,15 @@ KellyErrorEstimator<dim, spacedim>::estimate(
   const Strategy            strategy)
 {
   // just pass on to the other function
-  const std::vector<const ReadVector<Number> *> solutions(1, &solution);
-  std::vector<Vector<float> *>                  errors(1, &error);
+  std::vector<const ReadVector<Number> *> solutions(1, &solution);
+  std::vector<Vector<float> *>            errors(1, &error);
+  ArrayView<Vector<float> *>              error_view = make_array_view(errors);
   estimate(mapping,
            dof_handler,
            quadrature,
            neumann_bc,
-           solutions,
-           errors,
+           make_array_view(solutions),
+           error_view,
            component_mask,
            coefficients,
            n_threads,
@@ -1084,14 +1085,15 @@ KellyErrorEstimator<dim, spacedim>::estimate(
   const Strategy            strategy)
 {
   // just pass on to the other function
-  const std::vector<const ReadVector<Number> *> solutions(1, &solution);
-  std::vector<Vector<float> *>                  errors(1, &error);
+  std::vector<const ReadVector<Number> *> solutions(1, &solution);
+  std::vector<Vector<float> *>            errors(1, &error);
+  ArrayView<Vector<float> *>              error_view = make_array_view(errors);
   estimate(mapping,
            dof_handler,
            quadrature,
            neumann_bc,
-           solutions,
-           errors,
+           make_array_view(solutions),
+           error_view,
            component_mask,
            coefficients,
            n_threads,
@@ -1142,11 +1144,11 @@ KellyErrorEstimator<dim, spacedim>::estimate(
   const DoFHandler<dim, spacedim> &dof_handler,
   const hp::QCollection<dim - 1> & face_quadratures,
   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,
+    &                                          neumann_bc,
+  const ArrayView<const ReadVector<Number> *> &solutions,
+  ArrayView<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,
@@ -1309,15 +1311,15 @@ KellyErrorEstimator<dim, spacedim>::estimate(
   const DoFHandler<dim, spacedim> &dof_handler,
   const Quadrature<dim - 1> &      quadrature,
   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)
+    &                                          neumann_bc,
+  const ArrayView<const ReadVector<Number> *> &solutions,
+  ArrayView<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,
@@ -1342,15 +1344,15 @@ KellyErrorEstimator<dim, spacedim>::estimate(
   const DoFHandler<dim, spacedim> &dof_handler,
   const Quadrature<dim - 1> &      quadrature,
   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)
+    &                                          neumann_bc,
+  const ArrayView<const ReadVector<Number> *> &solutions,
+  ArrayView<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,
@@ -1375,15 +1377,15 @@ 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, 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)
+    &                                          neumann_bc,
+  const ArrayView<const ReadVector<Number> *> &solutions,
+  ArrayView<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 211ffe29f9f93f4e819d5a5d4754cdfaf059bfee..74c2cf4009fff69dad32f3ca2f5d51a0f30c60ab 100644 (file)
@@ -67,8 +67,8 @@ for (S : REAL_AND_COMPLEX_SCALARS; deal_II_dimension : DIMENSIONS;
          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 ArrayView<const ReadVector<S> *> &,
+         ArrayView<Vector<float> *> &,
          const ComponentMask &,
          const Function<deal_II_space_dimension> *,
          const unsigned int,
@@ -83,8 +83,8 @@ for (S : REAL_AND_COMPLEX_SCALARS; deal_II_dimension : DIMENSIONS;
          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 ArrayView<const ReadVector<S> *> &,
+         ArrayView<Vector<float> *> &,
          const ComponentMask &,
          const Function<deal_II_space_dimension> *,
          const unsigned int,
@@ -133,8 +133,8 @@ for (S : REAL_AND_COMPLEX_SCALARS; deal_II_dimension : DIMENSIONS;
          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 ArrayView<const ReadVector<S> *> &,
+         ArrayView<Vector<float> *> &,
          const ComponentMask &,
          const Function<deal_II_space_dimension> *,
          const unsigned int,
@@ -149,8 +149,8 @@ for (S : REAL_AND_COMPLEX_SCALARS; deal_II_dimension : DIMENSIONS;
          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 ArrayView<const ReadVector<S> *> &,
+         ArrayView<Vector<float> *> &,
          const ComponentMask &,
          const Function<deal_II_space_dimension> *,
          const unsigned int,
index 4ad0d8302a061c56143261d965eff0e7bf47d31e..ef13297851ce423ac1e1aa8a484f70e1b3d6484e 100644 (file)
@@ -74,14 +74,15 @@ KellyErrorEstimator<1, spacedim>::estimate(
   const Strategy            strategy)
 {
   // just pass on to the other function
-  const std::vector<const ReadVector<Number> *> solutions(1, &solution);
-  std::vector<Vector<float> *>                  errors(1, &error);
+  std::vector<const ReadVector<Number> *> solutions(1, &solution);
+  std::vector<Vector<float> *>            errors(1, &error);
+  ArrayView<Vector<float> *>              error_view = make_array_view(errors);
   estimate(mapping,
            dof_handler,
            quadrature,
            neumann_bc,
-           solutions,
-           errors,
+           make_array_view(solutions),
+           error_view,
            component_mask,
            coefficients,
            n_threads,
@@ -133,15 +134,15 @@ KellyErrorEstimator<1, spacedim>::estimate(
   const DoFHandler<1, spacedim> &dof_handler,
   const Quadrature<0> &          quadrature,
   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)
+    &                                          neumann_bc,
+  const ArrayView<const ReadVector<Number> *> &solutions,
+  ArrayView<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>(),
@@ -179,14 +180,15 @@ KellyErrorEstimator<1, spacedim>::estimate(
   const Strategy            strategy)
 {
   // just pass on to the other function
-  const std::vector<const ReadVector<Number> *> solutions(1, &solution);
-  std::vector<Vector<float> *>                  errors(1, &error);
+  std::vector<const ReadVector<Number> *> solutions(1, &solution);
+  std::vector<Vector<float> *>            errors(1, &error);
+  ArrayView<Vector<float> *>              error_view = make_array_view(errors);
   estimate(mapping,
            dof_handler,
            quadrature,
            neumann_bc,
-           solutions,
-           errors,
+           make_array_view(solutions),
+           error_view,
            component_mask,
            coefficients,
            n_threads,
@@ -238,15 +240,15 @@ KellyErrorEstimator<1, spacedim>::estimate(
   const DoFHandler<1, spacedim> &dof_handler,
   const hp::QCollection<0> &     quadrature,
   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)
+    &                                          neumann_bc,
+  const ArrayView<const ReadVector<Number> *> &solutions,
+  ArrayView<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>(),
@@ -273,11 +275,11 @@ KellyErrorEstimator<1, spacedim>::estimate(
   const DoFHandler<1, spacedim> &dof_handler,
   const hp::QCollection<0> &,
   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,
+    &                                          neumann_bc,
+  const ArrayView<const ReadVector<Number> *> &solutions,
+  ArrayView<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,
@@ -530,15 +532,15 @@ KellyErrorEstimator<1, spacedim>::estimate(
   const DoFHandler<1, spacedim> &dof_handler,
   const Quadrature<0> &          quadrature,
   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)
+    &                                          neumann_bc,
+  const ArrayView<const ReadVector<Number> *> &solutions,
+  ArrayView<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 ea3f510579c09f1126f87d7ba1350e6a1ffe09f3..c01a378e8e99269d3fb150ba971fda6b3dfb6cdc 100644 (file)
@@ -57,8 +57,8 @@ for (S : REAL_AND_COMPLEX_SCALARS; deal_II_dimension : DIMENSIONS;
          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 ArrayView<const ReadVector<S> *> &,
+         ArrayView<Vector<float> *> &,
          const ComponentMask &,
          const Function<deal_II_space_dimension> *,
          const unsigned int,
@@ -72,8 +72,8 @@ for (S : REAL_AND_COMPLEX_SCALARS; deal_II_dimension : DIMENSIONS;
          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 ArrayView<const ReadVector<S> *> &,
+         ArrayView<Vector<float> *> &,
          const ComponentMask &,
          const Function<deal_II_space_dimension> *,
          const unsigned int,
@@ -119,8 +119,8 @@ for (S : REAL_AND_COMPLEX_SCALARS; deal_II_dimension : DIMENSIONS;
          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 ArrayView<const ReadVector<S> *> &,
+         ArrayView<Vector<float> *> &,
          const ComponentMask &,
          const Function<deal_II_space_dimension> *,
          const unsigned int,
@@ -134,8 +134,8 @@ for (S : REAL_AND_COMPLEX_SCALARS; deal_II_dimension : DIMENSIONS;
          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 ArrayView<const ReadVector<S> *> &,
+         ArrayView<Vector<float> *> &,
          const ComponentMask &,
          const Function<deal_II_space_dimension> *,
          const unsigned int,
index 189221484cdcbb2211f8d4dccc269bb0981a0482..ecbff3aae72c946a37b2c2414d64c341f21c2d79 100644 (file)
@@ -488,9 +488,8 @@ namespace Step36
   EigenvalueProblem<dim>::estimate_error()
   {
     {
-      std::vector<const PETScWrappers::MPI::Vector *> sol(
-        number_of_eigenvalues);
-      std::vector<Vector<float> *> error(number_of_eigenvalues);
+      std::vector<const ReadVector<PetscScalar> *> sol(number_of_eigenvalues);
+      std::vector<Vector<float> *>                 error(number_of_eigenvalues);
 
       for (unsigned int i = 0; i < number_of_eigenvalues; ++i)
         {
@@ -502,12 +501,15 @@ namespace Step36
       face_quadrature_formula.push_back(QGauss<dim - 1>(3));
       face_quadrature_formula.push_back(QGauss<dim - 1>(3));
 
+      ArrayView<const ReadVector<PetscScalar> *> sol_view =
+        make_array_view(sol);
+      ArrayView<Vector<float> *> error_view = make_array_view(error);
       KellyErrorEstimator<dim>::estimate(
         dof_handler,
         face_quadrature_formula,
         std::map<types::boundary_id, const Function<dim> *>(),
-        sol,
-        error);
+        sol_view,
+        error_view);
     }
 
     // sum up for a global:
index dcd77b4fdf818de690a7745ae7d16ddf7a3d054a..9b8cdabcc4b75b99e0dc447aad9e15ac29db6239 100644 (file)
@@ -694,9 +694,8 @@ namespace Step36
   EigenvalueProblem<dim>::estimate_error()
   {
     {
-      std::vector<const PETScWrappers::MPI::Vector *> sol(
-        number_of_eigenvalues);
-      std::vector<dealii::Vector<float> *> error(number_of_eigenvalues);
+      std::vector<const ReadVector<PetscScalar> *> sol(number_of_eigenvalues);
+      std::vector<Vector<float> *>                 error(number_of_eigenvalues);
 
       for (unsigned int i = 0; i < number_of_eigenvalues; ++i)
         {
@@ -708,12 +707,15 @@ namespace Step36
       face_quadrature_formula.push_back(dealii::QGauss<dim - 1>(3));
       face_quadrature_formula.push_back(dealii::QGauss<dim - 1>(3));
 
+      ArrayView<const ReadVector<PetscScalar> *> sol_view =
+        make_array_view(sol);
+      ArrayView<Vector<float> *> error_view = make_array_view(error);
       KellyErrorEstimator<dim>::estimate(
         dof_handler,
         face_quadrature_formula,
         std::map<types::boundary_id, const Function<dim> *>(),
-        sol,
-        error);
+        sol_view,
+        error_view);
     }
 
     // sum up for a global:

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.