From: Peter Munch Date: Tue, 1 Feb 2022 09:19:42 +0000 (+0100) Subject: MatrixFreeTools::compute_diagonal(): do not initialize vector X-Git-Tag: v9.4.0-rc1~541^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F13316%2Fhead;p=dealii.git MatrixFreeTools::compute_diagonal(): do not initialize vector --- diff --git a/doc/news/changes/incompatibilities/20220201SchreterMunch b/doc/news/changes/incompatibilities/20220201SchreterMunch new file mode 100644 index 0000000000..1069f242a8 --- /dev/null +++ b/doc/news/changes/incompatibilities/20220201SchreterMunch @@ -0,0 +1,7 @@ +Changed: The function MatrixFreeTools::compute_diagonal() +does not initialize the output vector anymore. Users +need to call MatrixFree:initialize_dof_vector() themselves. +This change is required to be able to also support block +vectors. +
+(Magdalena Schreter, Peter Munch, 2022/02/01) diff --git a/include/deal.II/matrix_free/tools.h b/include/deal.II/matrix_free/tools.h index ef1a1c5e1a..b8e608b083 100644 --- a/include/deal.II/matrix_free/tools.h +++ b/include/deal.II/matrix_free/tools.h @@ -795,9 +795,6 @@ namespace MatrixFreeTools { using VectorType = LinearAlgebra::distributed::Vector; - // initialize vector - matrix_free.initialize_dof_vector(diagonal_global, dof_no); - int dummy = 0; matrix_free.template cell_loop( diff --git a/tests/matrix_free/compute_diagonal_util.h b/tests/matrix_free/compute_diagonal_util.h index 9f64e13871..e0da7eb793 100644 --- a/tests/matrix_free/compute_diagonal_util.h +++ b/tests/matrix_free/compute_diagonal_util.h @@ -101,6 +101,7 @@ public: double error_local_1, error_local_2, error_global; { + matrix_free.initialize_dof_vector(diagonal_global); MatrixFreeTools::compute_diagonal