diff --git a/dune/solvers/common/genericvectortools.hh b/dune/solvers/common/genericvectortools.hh index 50d2641e742f97694c5a4999d494270363224adf..4a1dcccf52055d582f87d4a16e227c6fda3d0807 100644 --- a/dune/solvers/common/genericvectortools.hh +++ b/dune/solvers/common/genericvectortools.hh @@ -22,6 +22,7 @@ #include <dune/istl/bvector.hh> #include <dune/matrix-vector/genericvectortools.hh> +#include <dune/matrix-vector/resize.hh> #include <dune/solvers/operators/sumoperator.hh> @@ -49,44 +50,12 @@ struct GenericVector //! Resize vector recursivly to size of given vector/matrix template <class VectorTypeA, class VectorTypeB> + DUNE_DEPRECATED_MSG("Please use Dune::MatrixVector::resize instead.") static void resize(VectorTypeA& a, const VectorTypeB& b) { - a.resize(b.size()); - typename VectorTypeB::const_iterator it = b.begin(); - typename VectorTypeB::const_iterator end = b.end(); - for(; it!=end; ++it) - GenericVector::resize(a[it.index()], *it); + Dune::MatrixVector::resize(a, b); } - template <class VectorTypeA, class T, class A> - static void resize(VectorTypeA& a, const Dune::BCRSMatrix<T,A>& b) - { - a.resize(b.N()); - typedef typename Dune::BCRSMatrix<T,A> VectorTypeB; - typename VectorTypeB::const_iterator it = b.begin(); - typename VectorTypeB::const_iterator end = b.end(); - for(; it!=end; ++it) - 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()); - 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 DUNE_UNUSED, const VectorTypeB& b DUNE_UNUSED) - {} - - template <int n, class VectorTypeB> - static void resize(std::bitset<n>& a DUNE_UNUSED, const VectorTypeB& b DUNE_UNUSED) - {} - //! Set vector to zero at indices that are true in bitvector recursivly template <class VectorType, class BitVectorType> DUNE_DEPRECATED_MSG("Please use Dune::MatrixVector::Generic::truncate instead.")