for (unsigned int i=min; i<=max; ++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<BlockVector<number>>();
- matrices[i].vmult = [&m, i](BlockVector<number> &v,
- const BlockVector<number> &u)
- {
- m[i].vmult(v, u);
- };
- matrices[i].Tvmult = [&m, i](BlockVector<number> &v,
- const BlockVector<number> &u)
- {
- m[i].Tvmult(v, u);
- };
-
- smoothers[i] = LinearOperator<BlockVector<number>>();
- smoothers[i].vmult = [&s, i](BlockVector<number> &v,
- const BlockVector<number> &u)
- {
- s[i].vmult(v, u);
- };
- smoothers[i].Tvmult = [&s, i](BlockVector<number> &v,
- const BlockVector<number> &u)
- {
- s[i].Tvmult(v, u);
- };
+ // Workaround: Unfortunately, not every "m[i]" object has a
+ // rich enough interface to populate reinit_(domain|range)_vector.
+ // Thus, apply an empty LinearOperator exemplar.
+ matrices[i] = linear_operator<BlockVector<number> >(
+ LinearOperator<BlockVector<number> >(), m[i]);
+ smoothers[i] = linear_operator<BlockVector<number> >(matrices[i], s[i]);
}
}
:
solver(&s, typeid(*this).name())
{
- matrix = linear_operator<VectorType>(m);
- precondition = linear_operator<VectorType>(m, p);
+ // Workaround: Unfortunately, not every "m" object has a rich enough
+ // interface to populate reinit_(domain|range)_vector. Thus, supply an
+ // empty LinearOperator exemplar.
+ matrix = linear_operator<VectorType>(LinearOperator<VectorType>(), m);
+ precondition = linear_operator<VectorType>(matrix, p);
}
const PreconditionerType &p)
{
solver = &s;
- matrix = linear_operator<VectorType>(m);
- precondition = linear_operator<VectorType>(m, p);
+ // Workaround: Unfortunately, not every "m" object has a rich enough
+ // interface to populate reinit_(domain|range)_vector. Thus, supply an
+ // empty LinearOperator exemplar.
+ matrix = linear_operator<VectorType>(LinearOperator<VectorType>(), m);
+ precondition = linear_operator<VectorType>(matrix, p);
}
MGCoarseGridLACIteration<SolverType, VectorType>
::set_matrix(const MatrixType &m)
{
- matrix = linear_operator<VectorType>(m);
+ // Workaround: Unfortunately, not every "m" object has a rich enough
+ // interface to populate reinit_(domain|range)_vector. Thus, supply an
+ // empty LinearOperator exemplar.
+ matrix = linear_operator<VectorType>(LinearOperator<VectorType>(), m);
}
DEAL_II_ENABLE_EXTRA_DIAGNOSTICS
matrices.resize(p.min_level(), p.max_level());
for (unsigned int level = p.min_level(); level <= p.max_level(); ++level)
{
- // 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[level] = LinearOperator<VectorType>();
- matrices[level].vmult = [&p, level](
- VectorType &v, const VectorType &u)
- {
- p[level].vmult(v, u);
- };
- matrices[level].Tvmult = [&p, level](
- VectorType &v, const VectorType &u)
- {
- p[level].Tvmult(v, u);
- };
+ // Workaround: Unfortunately, not every "p[level]" object has a
+ // rich enough interface to populate reinit_(domain|range)_vector.
+ // Thus, apply an empty LinearOperator exemplar.
+ matrices[level] =
+ linear_operator<VectorType>(LinearOperator<VectorType>(), p[level]);
}
}
for (unsigned int i=min; i<=max; ++i)
{
- matrices[i] = linear_operator<VectorType>(m[i]);
+ // Workaround: Unfortunately, not every "m[i]" object has a rich
+ // enough interface to populate reinit_(domain|range)_vector. Thus,
+ // apply an empty LinearOperator exemplar.
+ matrices[i] =
+ linear_operator<VectorType>(LinearOperator<VectorType>(), m[i]);
smoothers[i].initialize(m[i], data);
}
}
for (unsigned int i=min; i<=max; ++i)
{
- matrices[i] = linear_operator<VectorType>(m[i]);
+ // Workaround: Unfortunately, not every "m[i]" object has a rich
+ // enough interface to populate reinit_(domain|range)_vector. Thus,
+ // apply an empty LinearOperator exemplar.
+ matrices[i] =
+ linear_operator<VectorType>(LinearOperator<VectorType>(), m[i]);
smoothers[i].initialize(m[i], data[i]);
}
}
for (unsigned int i=min; i<=max; ++i)
{
- matrices[i] = &(m[i].block(row, col));
+ // Workaround: Unfortunately, not every "m[i]" object has a rich
+ // enough interface to populate reinit_(domain|range)_vector. Thus,
+ // apply an empty LinearOperator exemplar.
+ matrices[i] = linear_operator<VectorType>(LinearOperator<VectorType>(),
+ m[i].block(row, col));
smoothers[i].initialize(m[i].block(row, col), data);
}
}
for (unsigned int i=min; i<=max; ++i)
{
- matrices[i] = &(m[i].block(row, col));
+ // Workaround: Unfortunately, not every "m[i]" object has a rich
+ // enough interface to populate reinit_(domain|range)_vector. Thus,
+ // apply an empty LinearOperator exemplar.
+ matrices[i] = linear_operator<VectorType>(LinearOperator<VectorType>(),
+ m[i].block(row, col));
smoothers[i].initialize(m[i].block(row, col), data[i]);
}
}
for (unsigned int i=min; i<=max; ++i)
{
- matrices[i] = linear_operator<VectorType>(m[i]);
+ // Workaround: Unfortunately, not every "m[i]" object has a rich
+ // enough interface to populate reinit_(domain|range)_vector. Thus,
+ // apply an empty LinearOperator exemplar.
+ matrices[i] =
+ linear_operator<VectorType>(LinearOperator<VectorType>(), m[i]);
smoothers[i].initialize(m[i], data);
}
}
for (unsigned int i=min; i<=max; ++i)
{
- matrices[i] = linear_operator<VectorType>(m[i]);
+ // Workaround: Unfortunately, not every "m[i]" object has a rich
+ // enough interface to populate reinit_(domain|range)_vector. Thus,
+ // apply an empty LinearOperator exemplar.
+ matrices[i] =
+ linear_operator<VectorType>(LinearOperator<VectorType>(), m[i]);
smoothers[i].initialize(m[i], data[i]);
}
}