]> https://gitweb.dealii.org/ - dealii.git/commitdiff
FEEvaluation: Make sure that compiler can identify no-overlap of pointers 16769/head
authorMartin Kronbichler <martin.kronbichler@rub.de>
Thu, 21 Mar 2024 08:47:17 +0000 (09:47 +0100)
committerMartin Kronbichler <martin.kronbichler@rub.de>
Thu, 21 Mar 2024 08:47:17 +0000 (09:47 +0100)
include/deal.II/matrix_free/fe_evaluation.h

index a8247d1a4454e8777709ddae445820ef05a00631..d99940cc428810ff94f97053741c25c1347cbba4 100644 (file)
@@ -5052,19 +5052,21 @@ FEEvaluationBase<dim, n_components_, Number, is_face, VectorizedArrayType>::
   this->values_quad_submitted = true;
 #  endif
 
-  const std::size_t nqp = this->n_quadrature_points;
+  const std::size_t    nqp    = this->n_quadrature_points;
+  VectorizedArrayType *values = this->values_quad + q_point;
+
   if (this->cell_type <= internal::MatrixFreeFunctions::affine)
     {
       const VectorizedArrayType JxW =
         this->J_value[0] * this->quadrature_weights[q_point];
       for (unsigned int comp = 0; comp < n_components; ++comp)
-        this->values_quad[comp * nqp + q_point] = val_in[comp] * JxW;
+        values[comp * nqp] = val_in[comp] * JxW;
     }
   else
     {
       const VectorizedArrayType JxW = this->J_value[q_point];
       for (unsigned int comp = 0; comp < n_components; ++comp)
-        this->values_quad[comp * nqp + q_point] = val_in[comp] * JxW;
+        values[comp * nqp] = val_in[comp] * JxW;
     }
 }
 

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.