From: Rene Gassmoeller Date: Sat, 8 Jan 2022 17:50:22 +0000 (-0500) Subject: reintroduce get_mapping_data() X-Git-Tag: v9.4.0-rc1~612^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1f31992977f9fe819e141f575491967a5191244f;p=dealii.git reintroduce get_mapping_data() --- diff --git a/include/deal.II/matrix_free/fe_point_evaluation.h b/include/deal.II/matrix_free/fe_point_evaluation.h index dce59ef328..0428e2e2f2 100644 --- a/include/deal.II/matrix_free/fe_point_evaluation.h +++ b/include/deal.II/matrix_free/fe_point_evaluation.h @@ -409,6 +409,8 @@ namespace internal } // namespace FEPointEvaluation } // namespace internal + + /** * This class provides an interface to the evaluation of interpolated solution * values and gradients on cells on arbitrary reference point positions. These @@ -494,8 +496,8 @@ public: * a precomputed @p mapping_data object. This function can be used * to avoid duplicated evaluation of the mapping if multiple * FEPointEvaluation objects for the different components of the same FESystem - * are used. You can precompute the mapping data - * using the function internal::FEPointEvaluation::compute_mapping_data(). + * are used. You can get the mapping data from an initialized FEPointEvaluation + * object by calling the function get_mapping_data(). * * @param[in] cell An iterator to the current cell * @@ -512,6 +514,18 @@ public: const dealii::internal::FEValuesImplementation:: MappingRelatedData &mapping_data); + /** + * Returns the mapping data that was computed during the last call to + * the reinit() function. This can be useful if multiple FEPointEvaluation + * objects are used for multiple components of a FESystem. The mapping data + * can be retrieved from the first FEPointEvaluation object and subsequently + * passed to the other objects, avoiding the need to recompute the mapping + * data. + */ + const dealii::internal::FEValuesImplementation::MappingRelatedData & + get_mapping_data() const; + /** * This function interpolates the finite element solution, represented by * `solution_values`, on the cell and `unit_points` passed to reinit(). @@ -915,6 +929,16 @@ FEPointEvaluation::reinit( +template +const dealii::internal::FEValuesImplementation::MappingRelatedData & +FEPointEvaluation::get_mapping_data() const +{ + return mapping_data; +} + + + template void FEPointEvaluation::evaluate( diff --git a/tests/matrix_free/point_evaluation_15.cc b/tests/matrix_free/point_evaluation_15.cc index cb68738bad..310f403a24 100644 --- a/tests/matrix_free/point_evaluation_15.cc +++ b/tests/matrix_free/point_evaluation_15.cc @@ -112,15 +112,7 @@ test() evaluator1.evaluate(solution_values, EvaluationFlags::values | EvaluationFlags::gradients); - internal::FEValuesImplementation::MappingRelatedData mapping_data; - internal::FEPointEvaluation::compute_mapping_data_for_generic_points( - mapping, - cell, - unit_points, - update_values | update_gradients, - mapping_data); - - evaluator2.reinit(cell, unit_points, mapping_data); + evaluator2.reinit(cell, unit_points, evaluator1.get_mapping_data()); evaluator2.evaluate(solution_values, EvaluationFlags::values | EvaluationFlags::gradients); diff --git a/tests/matrix_free/point_evaluation_16.cc b/tests/matrix_free/point_evaluation_16.cc index dc01e6f75f..07f609d6b6 100644 --- a/tests/matrix_free/point_evaluation_16.cc +++ b/tests/matrix_free/point_evaluation_16.cc @@ -112,15 +112,7 @@ test(const unsigned int degree) evaluator.evaluate(solution_values, EvaluationFlags::values | EvaluationFlags::gradients); - internal::FEValuesImplementation::MappingRelatedData mapping_data; - internal::FEPointEvaluation::compute_mapping_data_for_generic_points( - mapping, - cell, - unit_points, - update_values | update_gradients, - mapping_data); - - evaluator2.reinit(cell, unit_points, mapping_data); + evaluator2.reinit(cell, unit_points, evaluator.get_mapping_data()); evaluator2.evaluate(solution_values, EvaluationFlags::values | EvaluationFlags::gradients);