From: Martin Kronbichler Date: Fri, 10 Dec 2021 15:31:56 +0000 (+0100) Subject: Fix two bugs in access of Hessians X-Git-Tag: v9.4.0-rc1~740^2~11 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=35af58d698500553a8f0630e526c0d9d7967f693;p=dealii.git Fix two bugs in access of Hessians --- diff --git a/include/deal.II/fe/mapping_q_internal.h b/include/deal.II/fe/mapping_q_internal.h index 49c4268f4f..b7069a987f 100644 --- a/include/deal.II/fe/mapping_q_internal.h +++ b/include/deal.II/fe/mapping_q_internal.h @@ -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 &renumber_to_lexicographic = data.shape_info.lexicographic_numbering; for (unsigned int i = 0; i < n_shape_values; ++i) diff --git a/include/deal.II/matrix_free/mapping_info.templates.h b/include/deal.II/matrix_free/mapping_info.templates.h index 8371df6190..c5658c9cab 100644 --- a/include/deal.II/matrix_free/mapping_info.templates.h +++ b/include/deal.II/matrix_free/mapping_info.templates.h @@ -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,