From 9ad664bad0ea107141c6ffc3da3a67283df28fa9 Mon Sep 17 00:00:00 2001 From: Max Kahnt <max.kahnt@fu-berlin.de> Date: Thu, 28 Sep 2017 18:45:22 +0200 Subject: [PATCH] Inject resize from SumOperator. --- dune/solvers/operators/sumoperator.hh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dune/solvers/operators/sumoperator.hh b/dune/solvers/operators/sumoperator.hh index 2ca77d92..ec044b5a 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 -- GitLab