From e3dded247e73453d2cb1e2548a96fa8435a1b33b Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Thu, 13 Jul 2017 14:19:12 -0500 Subject: [PATCH] Work around an incompatibility of MatrixBlockArray with linear_operator() --- include/deal.II/multigrid/mg_block_smoother.h | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/include/deal.II/multigrid/mg_block_smoother.h b/include/deal.II/multigrid/mg_block_smoother.h index 1a9c1ceb56..e6ba850c2a 100644 --- a/include/deal.II/multigrid/mg_block_smoother.h +++ b/include/deal.II/multigrid/mg_block_smoother.h @@ -194,8 +194,29 @@ MGSmootherBlock::initialize (const MGMatrixT for (unsigned int i=min; i<=max; ++i) { - matrices[i] = linear_operator >(m[i]); - smoothers[i] = linear_operator >(s[i]); + // Workaround: The matrix objects supplied to this class do not + // expose information how to reinitialize a vector. Therefore, + // populate vmult and Tvmult by hand... + + matrices[i] = LinearOperator>(); + matrices[i].vmult = [&m, i](BlockVector &v, + const BlockVector &u) { + m[i].vmult(v, u); + }; + matrices[i].Tvmult = [&m, i](BlockVector &v, + const BlockVector &u) { + m[i].Tvmult(v, u); + }; + + smoothers[i] = LinearOperator>(); + smoothers[i].vmult = [&s, i](BlockVector &v, + const BlockVector &u) { + s[i].vmult(v, u); + }; + smoothers[i].Tvmult = [&s, i](BlockVector &v, + const BlockVector &u) { + s[i].Tvmult(v, u); + }; } } -- 2.39.5