From: Maximilian Bergbauer Date: Fri, 26 May 2023 16:58:04 +0000 (+0200) Subject: Automatically use JxW in integrate when available X-Git-Tag: v9.5.0-rc1~169^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2255c4358385550be4c0ce9ad1cbb722bf48e23d;p=dealii.git Automatically use JxW in integrate when available --- diff --git a/doc/news/changes/incompatibilities/20230529Bergbauer b/doc/news/changes/incompatibilities/20230529Bergbauer new file mode 100644 index 0000000000..de74d410ab --- /dev/null +++ b/doc/news/changes/incompatibilities/20230529Bergbauer @@ -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(). +
+(Maximilian Bergbauer, 2023/05/29) diff --git a/include/deal.II/matrix_free/fe_point_evaluation.h b/include/deal.II/matrix_free/fe_point_evaluation.h index b2e5f20b29..5f26af5ff7 100644 --- a/include/deal.II/matrix_free/fe_point_evaluation.h +++ b/include/deal.II/matrix_free/fe_point_evaluation.h @@ -849,32 +849,53 @@ public: evaluate(const ArrayView & 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 & 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 & solution_values, - const EvaluationFlags::EvaluationFlags &integration_flags); + test_and_sum(const ArrayView & 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 void integrate_fast(const ArrayView & solution_values, const EvaluationFlags::EvaluationFlags &integration_flags); @@ -1078,10 +1100,18 @@ private: /** * Slow path of the integrate function using FEValues. */ + template void integrate_slow(const ArrayView & solution_values, const EvaluationFlags::EvaluationFlags &integration_flags); + /** + * Implementation of the integrate/test_and_sum function. + */ + template + void + do_integrate(const ArrayView & solution_values, + const EvaluationFlags::EvaluationFlags &integration_flags); /** * Number of quadrature batches of the current cell/face. @@ -1310,6 +1340,7 @@ FEPointEvaluation::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::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::finish_integrate_fast( template +template inline void FEPointEvaluation::integrate_fast( const ArrayView & solution_values, @@ -2185,7 +2218,12 @@ FEPointEvaluation::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::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::integrate_fast( template +template inline void FEPointEvaluation::integrate_slow( const ArrayView & solution_values, @@ -2250,7 +2291,8 @@ FEPointEvaluation::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::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::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::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::integrate_slow( template +template void -FEPointEvaluation::integrate( +FEPointEvaluation::do_integrate( const ArrayView & solution_values, const EvaluationFlags::EvaluationFlags &integration_flags) { @@ -2318,11 +2364,38 @@ FEPointEvaluation::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(solution_values, integration_flags); else - integrate_slow(solution_values, integration_flags); + integrate_slow(solution_values, integration_flags); +} + + + +template +void +FEPointEvaluation::integrate( + const ArrayView & solution_values, + const EvaluationFlags::EvaluationFlags &integration_flags) +{ + do_integrate(solution_values, integration_flags); +} + + + +template +void +FEPointEvaluation::test_and_sum( + const ArrayView & solution_values, + const EvaluationFlags::EvaluationFlags &integration_flags) +{ + do_integrate(solution_values, integration_flags); } diff --git a/include/deal.II/multigrid/mg_transfer_global_coarsening.templates.h b/include/deal.II/multigrid/mg_transfer_global_coarsening.templates.h index 96763e9864..f709a3e851 100644 --- a/include/deal.II/multigrid/mg_transfer_global_coarsening.templates.h +++ b/include/deal.II/multigrid/mg_transfer_global_coarsening.templates.h @@ -4080,7 +4080,7 @@ MGTwoLevelTransferNonNested>:: 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 diff --git a/tests/matrix_free/point_evaluation_01.cc b/tests/matrix_free/point_evaluation_01.cc index f0fe69fc80..5340a6eb22 100644 --- a/tests/matrix_free/point_evaluation_01.cc +++ b/tests/matrix_free/point_evaluation_01.cc @@ -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 << ' '; diff --git a/tests/matrix_free/point_evaluation_02.cc b/tests/matrix_free/point_evaluation_02.cc index 8d7bda13b8..b4a5eaec26 100644 --- a/tests/matrix_free/point_evaluation_02.cc +++ b/tests/matrix_free/point_evaluation_02.cc @@ -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 << ' '; diff --git a/tests/matrix_free/point_evaluation_03.cc b/tests/matrix_free/point_evaluation_03.cc index f14c18cb90..3bce4c9e94 100644 --- a/tests/matrix_free/point_evaluation_03.cc +++ b/tests/matrix_free/point_evaluation_03.cc @@ -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 << ' '; diff --git a/tests/matrix_free/point_evaluation_04.cc b/tests/matrix_free/point_evaluation_04.cc index 926f1b0a7c..605790f2da 100644 --- a/tests/matrix_free/point_evaluation_04.cc +++ b/tests/matrix_free/point_evaluation_04.cc @@ -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 << ' '; diff --git a/tests/matrix_free/point_evaluation_05.cc b/tests/matrix_free/point_evaluation_05.cc index 3d380b81c4..ca27df64a8 100644 --- a/tests/matrix_free/point_evaluation_05.cc +++ b/tests/matrix_free/point_evaluation_05.cc @@ -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 << ' '; diff --git a/tests/matrix_free/point_evaluation_06.cc b/tests/matrix_free/point_evaluation_06.cc index 3e960d2cfa..f937f1b9ed 100644 --- a/tests/matrix_free/point_evaluation_06.cc +++ b/tests/matrix_free/point_evaluation_06.cc @@ -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 << ' '; diff --git a/tests/matrix_free/point_evaluation_07.cc b/tests/matrix_free/point_evaluation_07.cc index 4348799731..3e09e37b70 100644 --- a/tests/matrix_free/point_evaluation_07.cc +++ b/tests/matrix_free/point_evaluation_07.cc @@ -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 << ' '; diff --git a/tests/matrix_free/point_evaluation_08.cc b/tests/matrix_free/point_evaluation_08.cc index 0cb7fcef5a..67706e0105 100644 --- a/tests/matrix_free/point_evaluation_08.cc +++ b/tests/matrix_free/point_evaluation_08.cc @@ -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 << ' '; diff --git a/tests/matrix_free/point_evaluation_09.cc b/tests/matrix_free/point_evaluation_09.cc index 9c2fc9e6bb..bfa0e709dc 100644 --- a/tests/matrix_free/point_evaluation_09.cc +++ b/tests/matrix_free/point_evaluation_09.cc @@ -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 << ' '; diff --git a/tests/matrix_free/point_evaluation_10.cc b/tests/matrix_free/point_evaluation_10.cc index 3b3b9e640f..9c44cb899e 100644 --- a/tests/matrix_free/point_evaluation_10.cc +++ b/tests/matrix_free/point_evaluation_10.cc @@ -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 << ' '; diff --git a/tests/matrix_free/point_evaluation_11.cc b/tests/matrix_free/point_evaluation_11.cc index f1c3fe2e9f..70b41630ce 100644 --- a/tests/matrix_free/point_evaluation_11.cc +++ b/tests/matrix_free/point_evaluation_11.cc @@ -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 << ' '; diff --git a/tests/matrix_free/point_evaluation_13.cc b/tests/matrix_free/point_evaluation_13.cc index ba8d139923..c5f7a315ac 100644 --- a/tests/matrix_free/point_evaluation_13.cc +++ b/tests/matrix_free/point_evaluation_13.cc @@ -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 << ' '; diff --git a/tests/matrix_free/point_evaluation_14.cc b/tests/matrix_free/point_evaluation_14.cc index 4745399ba7..33838795d7 100644 --- a/tests/matrix_free/point_evaluation_14.cc +++ b/tests/matrix_free/point_evaluation_14.cc @@ -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 << ' '; diff --git a/tests/matrix_free/point_evaluation_15.cc b/tests/matrix_free/point_evaluation_15.cc index 8dc2df4be1..b3a0361599 100644 --- a/tests/matrix_free/point_evaluation_15.cc +++ b/tests/matrix_free/point_evaluation_15.cc @@ -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] << ' '; diff --git a/tests/matrix_free/point_evaluation_16.cc b/tests/matrix_free/point_evaluation_16.cc index e2c12e0766..d599b2b749 100644 --- a/tests/matrix_free/point_evaluation_16.cc +++ b/tests/matrix_free/point_evaluation_16.cc @@ -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] << ' '; diff --git a/tests/matrix_free/point_evaluation_17.cc b/tests/matrix_free/point_evaluation_17.cc index 1a2c5ad76c..382ee70a3f 100644 --- a/tests/matrix_free/point_evaluation_17.cc +++ b/tests/matrix_free/point_evaluation_17.cc @@ -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] << ' '; diff --git a/tests/matrix_free/point_evaluation_21.cc b/tests/matrix_free/point_evaluation_21.cc index 25f5c347cc..1de352ec3b 100644 --- a/tests/matrix_free/point_evaluation_21.cc +++ b/tests/matrix_free/point_evaluation_21.cc @@ -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; diff --git a/tests/matrix_free/point_evaluation_22.cc b/tests/matrix_free/point_evaluation_22.cc index 077a3cf837..fb40b2a189 100644 --- a/tests/matrix_free/point_evaluation_22.cc +++ b/tests/matrix_free/point_evaluation_22.cc @@ -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 << ' '; diff --git a/tests/matrix_free/point_evaluation_23.cc b/tests/matrix_free/point_evaluation_23.cc index 8ee2b5bddf..cafc8bff57 100644 --- a/tests/matrix_free/point_evaluation_23.cc +++ b/tests/matrix_free/point_evaluation_23.cc @@ -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 << ' '; diff --git a/tests/matrix_free/point_evaluation_24.cc b/tests/matrix_free/point_evaluation_24.cc index 3a3bdd90e8..b545ad3c9d 100644 --- a/tests/matrix_free/point_evaluation_24.cc +++ b/tests/matrix_free/point_evaluation_24.cc @@ -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 << ' '; diff --git a/tests/non_matching/mapping_info.cc b/tests/non_matching/mapping_info.cc index a2b5b98dce..0545ee7208 100644 --- a/tests/non_matching/mapping_info.cc +++ b/tests/non_matching/mapping_info.cc @@ -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); } diff --git a/tests/remote_point_evaluation/remote_point_evaluation_01.cc b/tests/remote_point_evaluation/remote_point_evaluation_01.cc index 34d021d234..4205687c0d 100644 --- a/tests/remote_point_evaluation/remote_point_evaluation_01.cc +++ b/tests/remote_point_evaluation/remote_point_evaluation_01.cc @@ -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, diff --git a/tests/remote_point_evaluation/remote_point_evaluation_02.cc b/tests/remote_point_evaluation/remote_point_evaluation_02.cc index 8bd1be938a..d95195be72 100644 --- a/tests/remote_point_evaluation/remote_point_evaluation_02.cc +++ b/tests/remote_point_evaluation/remote_point_evaluation_02.cc @@ -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,