From: Matthias Maier Date: Thu, 13 Jul 2017 19:19:12 +0000 (-0500) Subject: Work around an incompatibility of MatrixBlockArray with linear_operator() X-Git-Tag: v9.0.0-rc1~1423^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e3dded247e73453d2cb1e2548a96fa8435a1b33b;p=dealii.git Work around an incompatibility of MatrixBlockArray with linear_operator() --- 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); + }; } }