From 82a69da86097d716401734ba01aebbdf53f91b8b Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Fri, 26 Aug 2022 16:16:34 +0200 Subject: [PATCH] Fix bug in matrix-free operators regarding diagonal --- include/deal.II/matrix_free/operators.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); -- 2.39.5