From dab8c5b928613b6952a1cde11e3c0b905e417218 Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Fri, 3 May 2024 17:16:42 +0200 Subject: [PATCH] FEPointEvaluation: Use separate reinit function for clearer separation --- .../deal.II/matrix_free/fe_point_evaluation.h | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/include/deal.II/matrix_free/fe_point_evaluation.h b/include/deal.II/matrix_free/fe_point_evaluation.h index c8428b20be..ef56931f7e 100644 --- a/include/deal.II/matrix_free/fe_point_evaluation.h +++ b/include/deal.II/matrix_free/fe_point_evaluation.h @@ -1454,6 +1454,14 @@ private: const StridedArrayView &solution_values, const EvaluationFlags::EvaluationFlags &integration_flags, const bool sum_into_values); + + /** + * Internal function to initialize the pointers of this class when an + * external MappingInfo has already queried the mapping for the relevant + * information. + */ + void + internal_reinit_single_cell_state_mapping_info(); }; @@ -2268,7 +2276,8 @@ FEPointEvaluation::FEPointEvaluation( template inline void -FEPointEvaluation::reinit() +FEPointEvaluation:: + internal_reinit_single_cell_state_mapping_info() { this->current_cell_index = numbers::invalid_unsigned_int; this->current_face_number = numbers::invalid_unsigned_int; @@ -2281,6 +2290,16 @@ FEPointEvaluation::reinit() +template +inline void +FEPointEvaluation::reinit() +{ + internal_reinit_single_cell_state_mapping_info(); + this->must_reinitialize_pointers = false; +} + + + template inline void FEPointEvaluation::reinit( @@ -2358,7 +2377,7 @@ FEPointEvaluation::evaluate( const EvaluationFlags::EvaluationFlags &evaluation_flags) { if (this->must_reinitialize_pointers) - reinit(); + internal_reinit_single_cell_state_mapping_info(); if (this->n_q_points == 0) return; @@ -3011,7 +3030,7 @@ FEPointEvaluation::do_integrate( const bool sum_into_values) { if (this->must_reinitialize_pointers) - reinit(); + internal_reinit_single_cell_state_mapping_info(); Assert(!(integration_flags & EvaluationFlags::hessians), ExcNotImplemented()); -- 2.39.5