From c33553f78ae1f317fa32cf36c85ad89c597b99b5 Mon Sep 17 00:00:00 2001 From: Ansgar Burchardt <Ansgar.Burchardt@tu-dresden.de> Date: Thu, 22 Oct 2015 12:51:09 +0200 Subject: [PATCH] Remove redundant implementation for virtualBlockSize = 1 The versions of "prolong" and "restrict" not taking a virtualBlockSize behave just the same as the other version with virtualBlockSize = 1. --- .../genericmultigridtransfer.hh | 59 +------------------ 1 file changed, 2 insertions(+), 57 deletions(-) diff --git a/dune/solvers/transferoperators/genericmultigridtransfer.hh b/dune/solvers/transferoperators/genericmultigridtransfer.hh index 6adca9fe..b1c3ffac 100644 --- a/dune/solvers/transferoperators/genericmultigridtransfer.hh +++ b/dune/solvers/transferoperators/genericmultigridtransfer.hh @@ -402,35 +402,7 @@ public: //! Multiply the vector f from the right to the prolongation matrix template<class TransferOperatorType, class DiscFuncType> - static void prolong(const TransferOperatorType& matrix, const DiscFuncType& f, DiscFuncType &t) - { - if (f.size() != matrix.M()) - DUNE_THROW(Dune::Exception, "Number of entries in the coarse grid vector is not equal " - << "to the number of columns of the interpolation matrix!"); - - t.resize(matrix.N()); - - typedef typename TransferOperatorType::row_type RowType; - typedef typename RowType::ConstIterator ColumnIterator; - - for(size_t rowIdx=0; rowIdx<matrix.N(); rowIdx++) - { - const RowType& row = matrix[rowIdx]; - - t[rowIdx] = 0.0; - - ColumnIterator cIt = row.begin(); - ColumnIterator cEndIt = row.end(); - - for(; cIt!=cEndIt; ++cIt) - umv(*cIt, f[cIt.index()], t[rowIdx]); - } - } - - - //! Multiply the vector f from the right to the prolongation matrix - template<class TransferOperatorType, class DiscFuncType> - static void prolong(const TransferOperatorType& matrix, const DiscFuncType& f, DiscFuncType &t, int virtualBlockSize) + static void prolong(const TransferOperatorType& matrix, const DiscFuncType& f, DiscFuncType &t, int virtualBlockSize = 1) { if (virtualBlockSize<0) virtualBlockSize = f.size()/matrix.M(); @@ -465,34 +437,7 @@ public: //! Multiply the vector f from the right to the transpose of the prolongation matrix template<class TransferOperatorType, class DiscFuncType> - static void restrict(const TransferOperatorType& matrix, const DiscFuncType& f, DiscFuncType &t) - { - if (f.size() != matrix.N()) - DUNE_THROW(Dune::Exception, "Fine grid vector has " << f.size() << " entries " - << "but the interpolation matrix has " << matrix.N() << " rows!"); - - t.resize(matrix.M()); - t = 0; - - typedef typename TransferOperatorType::row_type RowType; - typedef typename RowType::ConstIterator ColumnIterator; - - for (size_t rowIdx=0; rowIdx<matrix.N(); rowIdx++) - { - const RowType& row = matrix[rowIdx]; - - ColumnIterator cIt = row.begin(); - ColumnIterator cEndIt = row.end(); - - for(; cIt!=cEndIt; ++cIt) - umtv(*cIt, f[rowIdx], t[cIt.index()]); - } - } - - - //! Multiply the vector f from the right to the transpose of the prolongation matrix - template<class TransferOperatorType, class DiscFuncType> - static void restrict(const TransferOperatorType& matrix, const DiscFuncType& f, DiscFuncType &t, int virtualBlockSize) + static void restrict(const TransferOperatorType& matrix, const DiscFuncType& f, DiscFuncType &t, int virtualBlockSize = 1) { if (virtualBlockSize<0) virtualBlockSize = f.size()/matrix.N(); -- GitLab