]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix two bugs in access of Hessians
authorMartin Kronbichler <martin.kronbichler@it.uu.se>
Fri, 10 Dec 2021 15:31:56 +0000 (16:31 +0100)
committerMartin Kronbichler <martin.kronbichler@it.uu.se>
Sat, 11 Dec 2021 11:14:22 +0000 (12:14 +0100)
include/deal.II/fe/mapping_q_internal.h
include/deal.II/matrix_free/mapping_info.templates.h

index 49c4268f4f9ac77110b3b259f408dc79b1f71ac3..b7069a987fb064bace1fe15cd2ca253391c79f4d 100644 (file)
@@ -1143,6 +1143,11 @@ namespace internal
         {
           eval.set_data_pointers(&data.scratch, n_comp);
 
+          // make sure to initialize on all lanes also when some are unused in
+          // the code below
+          for (unsigned int i = 0; i < n_shape_values * n_comp; ++i)
+            eval.begin_dof_values()[i] = VectorizedArrayType();
+
           const std::vector<unsigned int> &renumber_to_lexicographic =
             data.shape_info.lexicographic_numbering;
           for (unsigned int i = 0; i < n_shape_values; ++i)
index 8371df619098300e0acfac6bd0545fa9a2ca8374..c5658c9cab7f0a885fed0f970ac5d2d111a5e871 100644 (file)
@@ -2131,13 +2131,13 @@ namespace internal
                     {
                       for (unsigned int e = 0; e < dim; ++e)
                         jac_grad[d][e][e] =
-                          eval.begin_gradients()[q + (d * hess_dim + e) *
-                                                       n_q_points];
+                          eval.begin_hessians()[q + (d * hess_dim + e) *
+                                                      n_q_points];
                       for (unsigned int c = dim, e = 0; e < dim; ++e)
                         for (unsigned int f = e + 1; f < dim; ++f, ++c)
                           jac_grad[d][e][f] = jac_grad[d][f][e] =
-                            eval.begin_gradients()[q + (d * hess_dim + c) *
-                                                         n_q_points];
+                            eval.begin_hessians()[q + (d * hess_dim + c) *
+                                                        n_q_points];
                       const auto inv_jac_grad =
                         process_jacobian_gradient(inv_transp_jac_permut,
                                                   inv_transp_jac,

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.