From: Martin Kronbichler Date: Fri, 26 Aug 2022 14:16:34 +0000 (+0200) Subject: Fix bug in matrix-free operators regarding diagonal X-Git-Tag: v9.5.0-rc1~1011^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F14224%2Fhead;p=dealii.git Fix bug in matrix-free operators regarding diagonal --- diff --git a/include/deal.II/matrix_free/operators.h b/include/deal.II/matrix_free/operators.h index 1cc69cbde1..226ba886b3 100644 --- a/include/deal.II/matrix_free/operators.h +++ b/include/deal.II/matrix_free/operators.h @@ -2382,7 +2382,8 @@ namespace MatrixFreeOperators VectorizedArrayType local_diagonal_vector[phi.static_dofs_per_cell]; for (unsigned int i = 0; i < phi.dofs_per_component; ++i) { - for (unsigned int j = 0; j < phi.dofs_per_component; ++j) + for (unsigned int j = 0; j < phi.dofs_per_component * n_components; + ++j) phi.begin_dof_values()[j] = VectorizedArrayType(); phi.begin_dof_values()[i] = 1.; do_operation_on_cell(phi, cell);