]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Automatically use JxW in integrate when available 15281/head
authorMaximilian Bergbauer <maximilian.bergbauer@tum.de>
Fri, 26 May 2023 16:58:04 +0000 (18:58 +0200)
committerMaximilian Bergbauer <maximilian.bergbauer@tum.de>
Thu, 1 Jun 2023 12:01:32 +0000 (14:01 +0200)
26 files changed:
doc/news/changes/incompatibilities/20230529Bergbauer [new file with mode: 0644]
include/deal.II/matrix_free/fe_point_evaluation.h
include/deal.II/multigrid/mg_transfer_global_coarsening.templates.h
tests/matrix_free/point_evaluation_01.cc
tests/matrix_free/point_evaluation_02.cc
tests/matrix_free/point_evaluation_03.cc
tests/matrix_free/point_evaluation_04.cc
tests/matrix_free/point_evaluation_05.cc
tests/matrix_free/point_evaluation_06.cc
tests/matrix_free/point_evaluation_07.cc
tests/matrix_free/point_evaluation_08.cc
tests/matrix_free/point_evaluation_09.cc
tests/matrix_free/point_evaluation_10.cc
tests/matrix_free/point_evaluation_11.cc
tests/matrix_free/point_evaluation_13.cc
tests/matrix_free/point_evaluation_14.cc
tests/matrix_free/point_evaluation_15.cc
tests/matrix_free/point_evaluation_16.cc
tests/matrix_free/point_evaluation_17.cc
tests/matrix_free/point_evaluation_21.cc
tests/matrix_free/point_evaluation_22.cc
tests/matrix_free/point_evaluation_23.cc
tests/matrix_free/point_evaluation_24.cc
tests/non_matching/mapping_info.cc
tests/remote_point_evaluation/remote_point_evaluation_01.cc
tests/remote_point_evaluation/remote_point_evaluation_02.cc

diff --git a/doc/news/changes/incompatibilities/20230529Bergbauer b/doc/news/changes/incompatibilities/20230529Bergbauer
new file mode 100644 (file)
index 0000000..de74d41
--- /dev/null
@@ -0,0 +1,6 @@
+Changed: The integrate() function of FEPointEvaluation now multiplies the submitted
+entities internally with a JxW value to represent a proper integration like in FEEvaluation.
+The old behavior (where the entities are only multiplied with the test functions and summed up)
+is available through the new function test_and_sum().
+<br>
+(Maximilian Bergbauer, 2023/05/29)
index b2e5f20b294e8b0e7d7ccead8096a678beee064a..5f26af5ff78d888d503c97dc542392f48e7f49a3 100644 (file)
@@ -849,32 +849,53 @@ public:
   evaluate(const ArrayView<const ScalarNumber> &   solution_values,
            const EvaluationFlags::EvaluationFlags &evaluation_flags);
 
+  /**
+   * This function multiplies the quantities passed in by previous
+   * submit_value() or submit_gradient() calls by the value or gradient of the
+   * test functions, and performs summation over all given points multiplied be
+   * the Jacobian determinant times the quadrature weight (JxW).
+   *
+   * @param[out] solution_values This array will contain the result of the
+   * integral, which can be used to during
+   * `cell->set_dof_values(solution_values, global_vector)` or
+   * `cell->distribute_local_to_global(solution_values, global_vector)`. Note
+   * that for multi-component systems where only some of the components are
+   * selected by the present class, the entries in `solution_values` not touched
+   * by this class will be set to zero.
+   *
+   * @param[in] integration_flags Flags specifying which quantities should be
+   * integrated at the points.
+   *
+   */
+  void
+  integrate(const ArrayView<ScalarNumber> &         solution_values,
+            const EvaluationFlags::EvaluationFlags &integration_flags);
+
   /**
    * This function multiplies the quantities passed in by previous
    * submit_value() or submit_gradient() calls by the value or gradient of the
    * test functions, and performs summation over all given points. This is
    * similar to the integration of a bilinear form in terms of the test
    * function, with the difference that this formula does not include a `JxW`
-   * factor. This allows the class to naturally embed point information
-   * (e.g. particles) into a finite element formulation. Of course, by
-   * multiplication of a `JxW` information of the data given to
-   * submit_value(), the integration can also be represented by this class.
+   * factor (in contrast to the integrate function of this class). This allows
+   * the class to naturally embed point information (e.g. particles) into a
+   * finite element formulation.
    *
    * @param[out] solution_values This array will contain the result of the
    * integral, which can be used to during
    * `cell->set_dof_values(solution_values, global_vector)` or
    * `cell->distribute_local_to_global(solution_values, global_vector)`. Note
    * that for multi-component systems where only some of the components are
-   * selected by the present class, the entries not touched by this class will
-   * be zeroed out.
+   * selected by the present class, the entries in `solution_values` not touched
+   * by this class will be set to zero.
    *
    * @param[in] integration_flags Flags specifying which quantities should be
    * integrated at the points.
    *
    */
   void
-  integrate(const ArrayView<ScalarNumber> &         solution_values,
-            const EvaluationFlags::EvaluationFlags &integration_flags);
+  test_and_sum(const ArrayView<ScalarNumber> &         solution_values,
+               const EvaluationFlags::EvaluationFlags &integration_flags);
 
   /**
    * Return the value at quadrature point number @p point_index after a call to
@@ -1071,6 +1092,7 @@ private:
   /**
    * Fast path of the integrate function.
    */
+  template <bool do_JxW>
   void
   integrate_fast(const ArrayView<ScalarNumber> &         solution_values,
                  const EvaluationFlags::EvaluationFlags &integration_flags);
@@ -1078,10 +1100,18 @@ private:
   /**
    * Slow path of the integrate function using FEValues.
    */
+  template <bool do_JxW>
   void
   integrate_slow(const ArrayView<ScalarNumber> &         solution_values,
                  const EvaluationFlags::EvaluationFlags &integration_flags);
 
+  /**
+   * Implementation of the integrate/test_and_sum function.
+   */
+  template <bool do_JxW>
+  void
+  do_integrate(const ArrayView<ScalarNumber> &         solution_values,
+               const EvaluationFlags::EvaluationFlags &integration_flags);
 
   /**
    * Number of quadrature batches of the current cell/face.
@@ -1310,6 +1340,7 @@ FEPointEvaluation<n_components_, dim, spacedim, Number>::FEPointEvaluation(
   , n_q_points_scalar(numbers::invalid_unsigned_int)
   , mapping(&mapping)
   , fe(&fe)
+  , JxW_ptr(nullptr)
   , use_face_path(false)
   , update_flags(update_flags)
   , mapping_info_on_the_fly(
@@ -1335,6 +1366,7 @@ FEPointEvaluation<n_components_, dim, spacedim, Number>::FEPointEvaluation(
   , n_q_points_scalar(numbers::invalid_unsigned_int)
   , mapping(&mapping_info.get_mapping())
   , fe(&fe)
+  , JxW_ptr(nullptr)
   , use_face_path(false)
   , update_flags(mapping_info.get_update_flags())
   , mapping_info(&mapping_info)
@@ -2141,6 +2173,7 @@ FEPointEvaluation<n_components_, dim, spacedim, Number>::finish_integrate_fast(
 
 
 template <int n_components_, int dim, int spacedim, typename Number>
+template <bool do_JxW>
 inline void
 FEPointEvaluation<n_components_, dim, spacedim, Number>::integrate_fast(
   const ArrayView<ScalarNumber> &         solution_values,
@@ -2185,7 +2218,12 @@ FEPointEvaluation<n_components_, dim, spacedim, Number>::integrate_fast(
           for (unsigned int v = 0;
                v < stride && (stride == 1 || q + v < n_q_points_scalar);
                ++v)
-            ETT::get_value(value, v, values[qb * stride + v]);
+            {
+              const unsigned int offset = qb * stride + v;
+              if (do_JxW)
+                values[offset] *= JxW_ptr[offset];
+              ETT::get_value(value, v, values[offset]);
+            }
         }
       if (integration_flags & EvaluationFlags::gradients)
         {
@@ -2205,6 +2243,8 @@ FEPointEvaluation<n_components_, dim, spacedim, Number>::integrate_fast(
                ++v)
             {
               const unsigned int offset = qb * stride + v;
+              if (do_JxW)
+                gradients[offset] *= JxW_ptr[offset];
               ETT::get_gradient(
                 gradient,
                 v,
@@ -2223,6 +2263,7 @@ FEPointEvaluation<n_components_, dim, spacedim, Number>::integrate_fast(
 
 
 template <int n_components_, int dim, int spacedim, typename Number>
+template <bool do_JxW>
 inline void
 FEPointEvaluation<n_components_, dim, spacedim, Number>::integrate_slow(
   const ArrayView<ScalarNumber> &         solution_values,
@@ -2250,7 +2291,8 @@ FEPointEvaluation<n_components_, dim, spacedim, Number>::integrate_slow(
                      v < n_lanes_user_interface && q + v < n_points;
                      ++v)
                   solution_values[i] += fe_values->shape_value(i, q + v) *
-                                        ETT::access(values[qb], v, d);
+                                        ETT::access(values[qb], v, d) *
+                                        (do_JxW ? fe_values->JxW(q + v) : 1.);
             else if (nonzero_shape_function_component[i][d])
               for (unsigned int qb = 0, q = 0; q < n_points;
                    ++qb, q += n_lanes_user_interface)
@@ -2259,7 +2301,8 @@ FEPointEvaluation<n_components_, dim, spacedim, Number>::integrate_slow(
                      ++v)
                   solution_values[i] +=
                     fe_values->shape_value_component(i, q + v, d) *
-                    ETT::access(values[qb], v, d);
+                    ETT::access(values[qb], v, d) *
+                    (do_JxW ? fe_values->JxW(q + v) : 1.);
         }
     }
 
@@ -2277,7 +2320,8 @@ FEPointEvaluation<n_components_, dim, spacedim, Number>::integrate_slow(
                      v < n_lanes_user_interface && q + v < n_points;
                      ++v)
                   solution_values[i] += fe_values->shape_grad(i, q + v) *
-                                        ETT::access(gradients[qb], v, d);
+                                        ETT::access(gradients[qb], v, d) *
+                                        (do_JxW ? fe_values->JxW(q + v) : 1.);
             else if (nonzero_shape_function_component[i][d])
               for (unsigned int qb = 0, q = 0; q < n_points;
                    ++qb, q += n_lanes_user_interface)
@@ -2286,7 +2330,8 @@ FEPointEvaluation<n_components_, dim, spacedim, Number>::integrate_slow(
                      ++v)
                   solution_values[i] +=
                     fe_values->shape_grad_component(i, q + v, d) *
-                    ETT::access(gradients[qb], v, d);
+                    ETT::access(gradients[qb], v, d) *
+                    (do_JxW ? fe_values->JxW(q + v) : 1.);
         }
     }
 }
@@ -2294,8 +2339,9 @@ FEPointEvaluation<n_components_, dim, spacedim, Number>::integrate_slow(
 
 
 template <int n_components_, int dim, int spacedim, typename Number>
+template <bool do_JxW>
 void
-FEPointEvaluation<n_components_, dim, spacedim, Number>::integrate(
+FEPointEvaluation<n_components_, dim, spacedim, Number>::do_integrate(
   const ArrayView<ScalarNumber> &         solution_values,
   const EvaluationFlags::EvaluationFlags &integration_flags)
 {
@@ -2318,11 +2364,38 @@ FEPointEvaluation<n_components_, dim, spacedim, Number>::integrate(
       return;
     }
 
+  Assert(
+    !do_JxW || JxW_ptr != nullptr,
+    ExcMessage(
+      "JxW pointer is not set! If you do not want to integrate() use test_and_sum()"));
+
   AssertDimension(solution_values.size(), fe->dofs_per_cell);
   if (fast_path)
-    integrate_fast(solution_values, integration_flags);
+    integrate_fast<do_JxW>(solution_values, integration_flags);
   else
-    integrate_slow(solution_values, integration_flags);
+    integrate_slow<do_JxW>(solution_values, integration_flags);
+}
+
+
+
+template <int n_components_, int dim, int spacedim, typename Number>
+void
+FEPointEvaluation<n_components_, dim, spacedim, Number>::integrate(
+  const ArrayView<ScalarNumber> &         solution_values,
+  const EvaluationFlags::EvaluationFlags &integration_flags)
+{
+  do_integrate<true>(solution_values, integration_flags);
+}
+
+
+
+template <int n_components_, int dim, int spacedim, typename Number>
+void
+FEPointEvaluation<n_components_, dim, spacedim, Number>::test_and_sum(
+  const ArrayView<ScalarNumber> &         solution_values,
+  const EvaluationFlags::EvaluationFlags &integration_flags)
+{
+  do_integrate<false>(solution_values, integration_flags);
 }
 
 
index 96763e986408f0bc90fd0d6f551d0cb31419ce26..f709a3e85109b38f4217d2e2b2cf6a429c526312 100644 (file)
@@ -4080,7 +4080,7 @@ MGTwoLevelTransferNonNested<dim, LinearAlgebra::distributed::Vector<Number>>::
           evaluator.submit_value(
             values[q + cell_data.reference_point_ptrs[cell]], q);
 
-        evaluator.integrate(solution_values, EvaluationFlags::values);
+        evaluator.test_and_sum(solution_values, EvaluationFlags::values);
 
         // resolve constraints and scatter
         internal::VectorDistributorLocalToGlobal<Number, VectorizedArrayType>
index f0fe69fc80681962d5136a1cd9c8ffeead1daea2..5340a6eb22d87b98c6dbb4d53e5f08be054d9bc4 100644 (file)
@@ -125,8 +125,9 @@ test(const unsigned int degree)
           evaluator.submit_gradient(evaluator.get_gradient(i), i);
         }
 
-      evaluator.integrate(solution_values,
-                          EvaluationFlags::values | EvaluationFlags::gradients);
+      evaluator.test_and_sum(solution_values,
+                             EvaluationFlags::values |
+                               EvaluationFlags::gradients);
 
       for (const auto i : solution_values)
         deallog << factor_float * i << ' ';
index 8d7bda13b8e63a2ef97a1c8adfe6aa43ed025c85..b4a5eaec26856a4fd7c2e64ad570573f56bcedbe 100644 (file)
@@ -118,8 +118,9 @@ test(const unsigned int degree)
           evaluator.submit_gradient(evaluator.get_gradient(i), i);
         }
 
-      evaluator.integrate(solution_values,
-                          EvaluationFlags::values | EvaluationFlags::gradients);
+      evaluator.test_and_sum(solution_values,
+                             EvaluationFlags::values |
+                               EvaluationFlags::gradients);
 
       for (const auto i : solution_values)
         deallog << i << ' ';
index f14c18cb9083370c52bfc66c7d9c9ab6018ea1d5..3bce4c9e9491730badbc6899470f6f542810494e 100644 (file)
@@ -134,8 +134,9 @@ test(const unsigned int degree)
           evaluator.submit_gradient(evaluator.get_gradient(i), i);
         }
 
-      evaluator.integrate(solution_values,
-                          EvaluationFlags::values | EvaluationFlags::gradients);
+      evaluator.test_and_sum(solution_values,
+                             EvaluationFlags::values |
+                               EvaluationFlags::gradients);
 
       for (const auto i : solution_values)
         deallog << i << ' ';
index 926f1b0a7c262b38e9d8cf60e44fb48a93eee34d..605790f2da144e85af5f2f504f45670bdc54f41a 100644 (file)
@@ -161,16 +161,17 @@ test(const unsigned int degree)
           evaluator_scalar.submit_gradient(evaluator_scalar.get_gradient(i), i);
         }
 
-      evaluator.integrate(solution_values,
-                          EvaluationFlags::values | EvaluationFlags::gradients);
+      evaluator.test_and_sum(solution_values,
+                             EvaluationFlags::values |
+                               EvaluationFlags::gradients);
 
       for (const auto i : solution_values)
         deallog << i << ' ';
       deallog << std::endl;
 
-      evaluator_scalar.integrate(solution_values,
-                                 EvaluationFlags::values |
-                                   EvaluationFlags::gradients);
+      evaluator_scalar.test_and_sum(solution_values,
+                                    EvaluationFlags::values |
+                                      EvaluationFlags::gradients);
 
       for (const auto i : solution_values)
         deallog << i << ' ';
index 3d380b81c4b04462d29597b8f68ed4bba9e41357..ca27df64a8ad2425d7698d5eca980be11d23f46a 100644 (file)
@@ -126,8 +126,9 @@ test(const unsigned int degree)
           evaluator.submit_gradient(evaluator.get_gradient(i), i);
         }
 
-      evaluator.integrate(solution_values,
-                          EvaluationFlags::values | EvaluationFlags::gradients);
+      evaluator.test_and_sum(solution_values,
+                             EvaluationFlags::values |
+                               EvaluationFlags::gradients);
 
       for (const auto i : solution_values)
         deallog << i << ' ';
index 3e960d2cfa2387986894749bff4220dd1c143331..f937f1b9ed1f46fd66dba54a14518a58abf27113 100644 (file)
@@ -127,8 +127,9 @@ test(const unsigned int degree)
           evaluator.submit_gradient(evaluator.get_gradient(i), i);
         }
 
-      evaluator.integrate(solution_values,
-                          EvaluationFlags::values | EvaluationFlags::gradients);
+      evaluator.test_and_sum(solution_values,
+                             EvaluationFlags::values |
+                               EvaluationFlags::gradients);
 
       for (const auto i : solution_values)
         deallog << i << ' ';
index 4348799731bd15f0c207755af0e60efa45fa0f96..3e09e37b700f84ca78887a49b323fac547fdc7ab 100644 (file)
@@ -141,8 +141,9 @@ test(const unsigned int degree)
           evaluator.submit_gradient(evaluator.get_gradient(i), i);
         }
 
-      evaluator.integrate(solution_values,
-                          EvaluationFlags::values | EvaluationFlags::gradients);
+      evaluator.test_and_sum(solution_values,
+                             EvaluationFlags::values |
+                               EvaluationFlags::gradients);
 
       for (const auto i : solution_values)
         deallog << i << ' ';
index 0cb7fcef5a448f346ce6209e4f6c9622462ad3f2..67706e0105e682a25edaa0f88b120ad884b7fc58 100644 (file)
@@ -168,16 +168,17 @@ test(const unsigned int degree)
           evaluator_scalar.submit_gradient(evaluator_scalar.get_gradient(i), i);
         }
 
-      evaluator.integrate(solution_values,
-                          EvaluationFlags::values | EvaluationFlags::gradients);
+      evaluator.test_and_sum(solution_values,
+                             EvaluationFlags::values |
+                               EvaluationFlags::gradients);
 
       for (const auto i : solution_values)
         deallog << i << ' ';
       deallog << std::endl;
 
-      evaluator_scalar.integrate(solution_values,
-                                 EvaluationFlags::values |
-                                   EvaluationFlags::gradients);
+      evaluator_scalar.test_and_sum(solution_values,
+                                    EvaluationFlags::values |
+                                      EvaluationFlags::gradients);
 
       for (const auto i : solution_values)
         deallog << i << ' ';
index 9c2fc9e6bbc12dde19e08c6091a8776512c6df39..bfa0e709dc8612025f4e96488e6b88e4acb88490 100644 (file)
@@ -142,8 +142,9 @@ test(const unsigned int degree)
           evaluator.submit_gradient(evaluator.get_gradient(i), i);
         }
 
-      evaluator.integrate(solution_values,
-                          EvaluationFlags::values | EvaluationFlags::gradients);
+      evaluator.test_and_sum(solution_values,
+                             EvaluationFlags::values |
+                               EvaluationFlags::gradients);
 
       for (const auto i : solution_values)
         deallog << i << ' ';
index 3b3b9e640f3dfe95d80a34b885e314c33bf9fa1d..9c44cb899e5bd33a246d1252e06d85b2a9c10136 100644 (file)
@@ -120,8 +120,9 @@ test(const unsigned int degree)
           evaluator.submit_gradient(evaluator.get_gradient(i), i);
         }
 
-      evaluator.integrate(solution_values,
-                          EvaluationFlags::values | EvaluationFlags::gradients);
+      evaluator.test_and_sum(solution_values,
+                             EvaluationFlags::values |
+                               EvaluationFlags::gradients);
 
       for (const auto i : solution_values)
         deallog << i << ' ';
index f1c3fe2e9f49712315a1455b7e603cc23d6a7936..70b41630ce612981875b16fa75b72fa7f0bcef14 100644 (file)
@@ -118,8 +118,9 @@ test(const unsigned int degree)
           evaluator.submit_gradient(evaluator.get_gradient(i), i);
         }
 
-      evaluator.integrate(solution_values,
-                          EvaluationFlags::values | EvaluationFlags::gradients);
+      evaluator.test_and_sum(solution_values,
+                             EvaluationFlags::values |
+                               EvaluationFlags::gradients);
 
       for (const auto i : solution_values)
         deallog << i << ' ';
index ba8d139923c7b63a0f50c795cf0b11b4f775e831..c5f7a315ac30f6b1b4b0fc7b910c773762b41b69 100644 (file)
@@ -132,8 +132,9 @@ test()
           evaluator.submit_gradient(evaluator.get_gradient(i), i);
         }
 
-      evaluator.integrate(solution_values,
-                          EvaluationFlags::values | EvaluationFlags::gradients);
+      evaluator.test_and_sum(solution_values,
+                             EvaluationFlags::values |
+                               EvaluationFlags::gradients);
 
       for (const auto i : solution_values)
         deallog << i << ' ';
index 4745399ba7d66f806a8447ebbe27f45ed00582a5..33838795d76dd165974f64840382b6ac8ecb063c 100644 (file)
@@ -137,8 +137,9 @@ test(const unsigned int degree)
           evaluator.submit_gradient(evaluator.get_gradient(i), i);
         }
 
-      evaluator.integrate(solution_values,
-                          EvaluationFlags::values | EvaluationFlags::gradients);
+      evaluator.test_and_sum(solution_values,
+                             EvaluationFlags::values |
+                               EvaluationFlags::gradients);
 
       for (const auto i : solution_values)
         deallog << i << ' ';
index 8dc2df4be12edc2cfc622fc0100494bf3b1ecdb4..b3a03615994345e296f32d5543779709b32a3832 100644 (file)
@@ -134,12 +134,12 @@ test()
           evaluator2.submit_gradient(evaluator2.get_gradient(i), i);
         }
 
-      evaluator1.integrate(solution_values,
-                           EvaluationFlags::values |
-                             EvaluationFlags::gradients);
-      evaluator2.integrate(solution_values2,
-                           EvaluationFlags::values |
-                             EvaluationFlags::gradients);
+      evaluator1.test_and_sum(solution_values,
+                              EvaluationFlags::values |
+                                EvaluationFlags::gradients);
+      evaluator2.test_and_sum(solution_values2,
+                              EvaluationFlags::values |
+                                EvaluationFlags::gradients);
 
       for (unsigned int i = 0; i < solution_values.size(); ++i)
         deallog << solution_values[i] - solution_values2[i] << ' ';
index e2c12e07660908c530c5f7f1d86191db7436644e..d599b2b749ce18eda6e069338e36761e7a5c2215 100644 (file)
@@ -136,11 +136,12 @@ test(const unsigned int degree)
           evaluator2.submit_gradient(evaluator2.get_gradient(i), i);
         }
 
-      evaluator.integrate(solution_values,
-                          EvaluationFlags::values | EvaluationFlags::gradients);
-      evaluator2.integrate(solution_values2,
-                           EvaluationFlags::values |
-                             EvaluationFlags::gradients);
+      evaluator.test_and_sum(solution_values,
+                             EvaluationFlags::values |
+                               EvaluationFlags::gradients);
+      evaluator2.test_and_sum(solution_values2,
+                              EvaluationFlags::values |
+                                EvaluationFlags::gradients);
 
       for (unsigned int i = 0; i < solution_values.size(); ++i)
         deallog << solution_values[i] - solution_values2[i] << ' ';
index 1a2c5ad76cd7b7361e157b71c3b1f466ffbc9197..382ee70a3fb69d27c5122ea5fb095eb4af34aa5b 100644 (file)
@@ -137,12 +137,12 @@ test()
           evaluator2.submit_gradient(evaluator2.get_gradient(i), i);
         }
 
-      evaluator1.integrate(solution_values,
-                           EvaluationFlags::values |
-                             EvaluationFlags::gradients);
-      evaluator2.integrate(solution_values2,
-                           EvaluationFlags::values |
-                             EvaluationFlags::gradients);
+      evaluator1.test_and_sum(solution_values,
+                              EvaluationFlags::values |
+                                EvaluationFlags::gradients);
+      evaluator2.test_and_sum(solution_values2,
+                              EvaluationFlags::values |
+                                EvaluationFlags::gradients);
 
       for (unsigned int i = 0; i < solution_values.size(); ++i)
         deallog << solution_values[i] - solution_values2[i] << ' ';
index 25f5c347ccdf113551941b43377a40811a63747e..1de352ec3b803ab26e36129c7ceb20fa2a14ae05 100644 (file)
@@ -130,15 +130,16 @@ test(const unsigned int degree)
           evaluator_move.submit_gradient(evaluator_move.get_gradient(i), i);
         }
 
-      evaluator.integrate(solution_values,
-                          EvaluationFlags::values | EvaluationFlags::gradients);
+      evaluator.test_and_sum(solution_values,
+                             EvaluationFlags::values |
+                               EvaluationFlags::gradients);
 
       for (const auto i : solution_values)
         deallog << factor_float * i << ' ';
 
-      evaluator_move.integrate(solution_values,
-                               EvaluationFlags::values |
-                                 EvaluationFlags::gradients);
+      evaluator_move.test_and_sum(solution_values,
+                                  EvaluationFlags::values |
+                                    EvaluationFlags::gradients);
 
       deallog << std::endl;
 
index 077a3cf8373a4ba653fe08d2cad3de20e3ad74c3..fb40b2a1891774f495347d6c2a239f70fd9049a3 100644 (file)
@@ -147,8 +147,9 @@ test(const unsigned int degree, const bool is_mapping_q = true)
           evaluator.submit_gradient(evaluator.get_gradient(i), i);
         }
 
-      evaluator.integrate(solution_values,
-                          EvaluationFlags::values | EvaluationFlags::gradients);
+      evaluator.test_and_sum(solution_values,
+                             EvaluationFlags::values |
+                               EvaluationFlags::gradients);
 
       for (const auto i : solution_values)
         deallog << factor_float * i << ' ';
index 8ee2b5bddf8733d6e746a2ceb30cc2757633d6fc..cafc8bff57d4c83a4297cc843742fbd39bc131e3 100644 (file)
@@ -138,9 +138,9 @@ test(const unsigned int degree)
               evaluator.submit_gradient(evaluator.get_gradient(i), i);
             }
 
-          evaluator.integrate(solution_values_out,
-                              EvaluationFlags::values |
-                                EvaluationFlags::gradients);
+          evaluator.test_and_sum(solution_values_out,
+                                 EvaluationFlags::values |
+                                   EvaluationFlags::gradients);
 
           for (double i : solution_values_out)
             deallog << i << ' ';
index 3a3bdd90e812c15f4ae4218655fb93de0cceba3a..b545ad3c9d91ff5b00cab70861b55e947405f523 100644 (file)
@@ -138,9 +138,9 @@ test(const unsigned int degree)
               evaluator.submit_gradient(evaluator.get_gradient(i), i);
             }
 
-          evaluator.integrate(solution_values_out,
-                              EvaluationFlags::values |
-                                EvaluationFlags::gradients);
+          evaluator.test_and_sum(solution_values_out,
+                                 EvaluationFlags::values |
+                                   EvaluationFlags::gradients);
 
           for (double i : solution_values_out)
             deallog << i << ' ';
index a2b5b98dce142881e4a12c7835799a1e11c942ee..0545ee7208e51cd5fabeab0b7127f717b455b6dd 100644 (file)
@@ -211,9 +211,8 @@ test(const bool filtered_compression)
 
         for (const auto q : fe_point.quadrature_point_indices())
           {
-            fe_point.submit_value(fe_point.JxW(q) * fe_point.get_value(q), q);
-            fe_point.submit_gradient(fe_point.JxW(q) * fe_point.get_gradient(q),
-                                     q);
+            fe_point.submit_value(fe_point.get_value(q), q);
+            fe_point.submit_gradient(fe_point.get_gradient(q), q);
           }
 
         fe_point.integrate(solution_values_out,
@@ -247,13 +246,12 @@ test(const bool filtered_compression)
 
           for (const auto q : fe_point_faces_m.quadrature_point_indices())
             {
-              fe_point_faces_m.submit_value(fe_point_faces_m.JxW(q) *
-                                              (fe_point_faces_m.get_value(q) -
-                                               fe_point_faces_p.get_value(q)),
+              fe_point_faces_m.submit_value(fe_point_faces_m.get_value(q) -
+                                              fe_point_faces_p.get_value(q),
                                             q);
               fe_point_faces_m.submit_gradient(
-                fe_point_faces_m.JxW(q) * (fe_point_faces_m.get_gradient(q) -
-                                           fe_point_faces_p.get_gradient(q)),
+                fe_point_faces_m.get_gradient(q) -
+                  fe_point_faces_p.get_gradient(q),
                 q);
             }
 
index 34d021d234c93282a3418760823b5fcf61b16377..4205687c0dc17f6766fd89092e60b691a8ec0b67 100644 (file)
@@ -384,7 +384,7 @@ compute_force_vector_sharp_interface(
         for (unsigned int q = 0; q < unit_points.size(); ++q)
           phi_force.submit_value(force_JxW[q], q);
 
-        phi_force.integrate(buffer, EvaluationFlags::values);
+        phi_force.test_and_sum(buffer, EvaluationFlags::values);
 
         constraints.distribute_local_to_global(buffer,
                                                local_dof_indices,
index 8bd1be938ac468869fd809afdc31cabe0cb83e87..d95195be72f99a211b9ea9b1810fef5301a30c98 100644 (file)
@@ -313,7 +313,7 @@ compute_force_vector_sharp_interface(
 
         // integrate_scatter force
         {
-          phi_force.integrate(buffer_dim, EvaluationFlags::values);
+          phi_force.test_and_sum(buffer_dim, EvaluationFlags::values);
 
           constraints.distribute_local_to_global(buffer_dim,
                                                  local_dof_indices_dim,

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.