]> https://gitweb.dealii.org/ - dealii.git/commitdiff
FEPointEvaluation: Use separate reinit function for clearer separation 16958/head
authorMartin Kronbichler <martin.kronbichler@rub.de>
Fri, 3 May 2024 15:16:42 +0000 (17:16 +0200)
committerMartin Kronbichler <martin.kronbichler@rub.de>
Fri, 24 May 2024 15:27:21 +0000 (17:27 +0200)
include/deal.II/matrix_free/fe_point_evaluation.h

index c8428b20be01b04290bf4fb0af36e3857cc2a00f..ef56931f7e4b1d41494b72c7b2a54f1fcc017793 100644 (file)
@@ -1454,6 +1454,14 @@ private:
     const StridedArrayView<ScalarNumber, stride_view> &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<n_components_, dim, spacedim, Number>::FEPointEvaluation(
 
 template <int n_components_, int dim, int spacedim, typename Number>
 inline void
-FEPointEvaluation<n_components_, dim, spacedim, Number>::reinit()
+FEPointEvaluation<n_components_, dim, spacedim, Number>::
+  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<n_components_, dim, spacedim, Number>::reinit()
 
 
 
+template <int n_components_, int dim, int spacedim, typename Number>
+inline void
+FEPointEvaluation<n_components_, dim, spacedim, Number>::reinit()
+{
+  internal_reinit_single_cell_state_mapping_info();
+  this->must_reinitialize_pointers = false;
+}
+
+
+
 template <int n_components_, int dim, int spacedim, typename Number>
 inline void
 FEPointEvaluation<n_components_, dim, spacedim, Number>::reinit(
@@ -2358,7 +2377,7 @@ FEPointEvaluation<n_components_, dim, spacedim, Number>::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<n_components_, dim, spacedim, Number>::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());
 

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.