From: Maximilian Bergbauer Date: Tue, 3 Dec 2024 14:59:08 +0000 (+0100) Subject: Use constructor argument X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e8f6565d9971ba82f5ec17312bd46655136f50f0;p=dealii.git Use constructor argument --- diff --git a/include/deal.II/matrix_free/fe_point_evaluation.h b/include/deal.II/matrix_free/fe_point_evaluation.h index 27569a944f..f916b12527 100644 --- a/include/deal.II/matrix_free/fe_point_evaluation.h +++ b/include/deal.II/matrix_free/fe_point_evaluation.h @@ -1171,11 +1171,19 @@ public: * @param first_selected_component For multi-component FiniteElement * objects, this parameter allows to select a range of `n_components` * components starting from this parameter. + * + * @param lexicographic_numbering If this class is used together with + * FEEvaluation this parameter should be set to 'true' because FEEvaluation + * stores the DoF values internally always in lexicographic numbering. + * Otherwise, the numbering detected from the FiniteElement passed to this + * class will be used (which is lexicographic for e.g. FE_DGQ but hierarchic + * for FE_Q). */ FEPointEvaluation(const Mapping &mapping, const FiniteElement &fe, const UpdateFlags update_flags, - const unsigned int first_selected_component = 0); + const unsigned int first_selected_component = 0, + const bool lexicographic_numbering = false); /** * Constructor to make the present class able to re-use the geometry @@ -1192,11 +1200,19 @@ public: * @param first_selected_component For multi-component FiniteElement * objects, this parameter allows to select a range of `n_components` * components starting from this parameter. + * + * @param lexicographic_numbering If this class is used together with + * FEEvaluation this parameter should be set to 'true' because FEEvaluation + * stores the DoF values internally always in lexicographic numbering. + * Otherwise, the numbering detected from the FiniteElement passed to this + * class will be used (which is lexicographic for e.g. FE_DGQ but hierarchic + * for FE_Q). */ FEPointEvaluation( const NonMatching::MappingInfo &mapping_info, const FiniteElement &fe, - const unsigned int first_selected_component = 0); + const unsigned int first_selected_component = 0, + const bool lexicographic_numbering = false); /** * Set up the mapping information for the given cell, e.g., by computing the @@ -1411,6 +1427,8 @@ private: static constexpr std::size_t stride = internal::VectorizedArrayTrait::stride(); + const bool lexicographic_numbering; + /** * Resizes necessary data fields, reads in and renumbers solution values. * Interpolates onto face if face path is selected. @@ -2358,11 +2376,13 @@ template FEPointEvaluation::FEPointEvaluation( const NonMatching::MappingInfo &mapping_info, const FiniteElement &fe, - const unsigned int first_selected_component) + const unsigned int first_selected_component, + const bool lexicographic_numbering) : FEPointEvaluationBase( mapping_info, fe, first_selected_component) + , lexicographic_numbering(lexicographic_numbering || this->renumber.empty()) {} @@ -2372,12 +2392,14 @@ FEPointEvaluation::FEPointEvaluation( const Mapping &mapping, const FiniteElement &fe, const UpdateFlags update_flags, - const unsigned int first_selected_component) + const unsigned int first_selected_component, + const bool lexicographic_numbering) : FEPointEvaluationBase( mapping, fe, update_flags, first_selected_component) + , lexicographic_numbering(lexicographic_numbering || this->renumber.empty()) {} @@ -2632,7 +2654,7 @@ FEPointEvaluation::prepare_evaluate_fast( const std::size_t offset = (this->component_in_base_element + comp) * dofs_per_comp; - if ((is_linear && n_components == 1) || this->renumber.empty()) + if ((is_linear && n_components == 1) || lexicographic_numbering) { for (unsigned int i = 0; i < dofs_per_comp; ++i) ETT::read_value(solution_values[i + offset], @@ -2934,7 +2956,7 @@ FEPointEvaluation::finish_integrate_fast( const std::size_t offset = (this->component_in_base_element + comp) * dofs_per_comp; - if (is_linear || this->renumber.empty()) + if (is_linear || lexicographic_numbering) { for (unsigned int i = 0; i < dofs_per_comp; ++i) if (sum_into_values)