From 24e11110d5669c6693baa23f79ce08fd3466f389 Mon Sep 17 00:00:00 2001 From: David Schneider Date: Wed, 20 Sep 2023 08:40:40 +0200 Subject: [PATCH] Fix gradient layout in FE evaluation according to deal.II v 9.6 (#63) * Fix gradient layout in FE evaluation according to deal.II v 9.6 * Backwards compatibility * Typo --- include/solid_mechanics/mf_nh_operator.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/include/solid_mechanics/mf_nh_operator.h b/include/solid_mechanics/mf_nh_operator.h index 0431791..07b5924 100644 --- a/include/solid_mechanics/mf_nh_operator.h +++ b/include/solid_mechanics/mf_nh_operator.h @@ -871,10 +871,18 @@ NeoHookOperator::do_operation_on_cell(FECellIntegrator &phi) const { VectorizedArrayType sum = inv_jac[e][0] * +#if DEAL_II_VERSION_GTE(9, 6, 0) + ref_grads[(d * n_q_points + q) * dim + 0]; +#else ref_grads[(d * dim + 0) * n_q_points + q]; +#endif for (unsigned int f = 1; f < dim; ++f) sum += inv_jac[e][f] * +#if DEAL_II_VERSION_GTE(9, 6, 0) + ref_grads[(d * n_q_points + q) * dim + f]; +#else ref_grads[(d * dim + f) * n_q_points + q]; +#endif F[d][e] = sum; // since we already have the inverse Jacobian, @@ -883,10 +891,18 @@ NeoHookOperator::do_operation_on_cell(FECellIntegrator &phi) const // same otherwise) VectorizedArrayType sum2 = inv_jac[e][0] * +#if DEAL_II_VERSION_GTE(9, 6, 0) + x_grads[(d * n_q_points + q) * dim + 0]; +#else x_grads[(d * dim + 0) * n_q_points + q]; +#endif for (unsigned int f = 1; f < dim; ++f) sum2 += inv_jac[e][f] * +#if DEAL_II_VERSION_GTE(9, 6, 0) + x_grads[(d * n_q_points + q) * dim + f]; +#else x_grads[(d * dim + f) * n_q_points + q]; +#endif grad_Nx_v[d][e] = sum2; } F[d][d] += one;