diff --git a/dune/solvers/operators/sumoperator.hh b/dune/solvers/operators/sumoperator.hh index 2ca77d92906cf923c46d9e9e7e317aaa40752697..ec044b5ab951dfdd37eac1716e341095fb7fb6ea 100644 --- a/dune/solvers/operators/sumoperator.hh +++ b/dune/solvers/operators/sumoperator.hh @@ -4,6 +4,7 @@ #define SUMOPERATOR_HH #include <cstddef> +#include <dune/matrix-vector/resize.hh> /** \brief represents the sum of two linear operators * @@ -139,5 +140,14 @@ class SumOperator const bool summands_allocated_internally_; }; +//! inject the resize from SumOperator to generic vector tools +namespace Dune { namespace MatrixVector { +template <class Vector, class SparseMatrix, class LowRankMatrix> +//! Resize vector from SumOperator. Note that we only consider the sparse part. +void resize(Vector& v, const SumOperator<SparseMatrix, LowRankMatrix>& sumOp) { + resize(v, sumOp.sparseMatrix()); +} +}} + #endif