diff --git a/dune/solvers/common/genericvectortools.hh b/dune/solvers/common/genericvectortools.hh index a77b2b62f352d585669dc028cb179e458ce520e8..18d850d9e634d113bda72735bb0f00461ca8ffb4 100644 --- a/dune/solvers/common/genericvectortools.hh +++ b/dune/solvers/common/genericvectortools.hh @@ -80,6 +80,17 @@ struct GenericVector GenericVector::resize(a[it.index()], *(it->begin())); } + template <class VectorTypeA, class SparseMatrixType, class LowRankMatrixType> + static void resize(VectorTypeA& a, const SumOperator<SparseMatrixType, LowRankMatrixType>& b) + { + a.resize(b.N()); + typedef SumOperator<SparseMatrixType,LowRankMatrixType> TypeB; + typename SparseMatrixType::const_iterator it = b.sparseMatrix().begin(); + typename SparseMatrixType::const_iterator end = b.sparseMatrix().end(); + for(; it!=end; ++it) + GenericVector::resize(a[it.index()], *(it->begin())); + } + template <class field_type, int n, class VectorTypeB> static void resize(Dune::FieldVector<field_type,n>& a, const VectorTypeB& b) {}