diff --git a/dune/solvers/transferoperators/truncatedmgtransfer.hh b/dune/solvers/transferoperators/truncatedmgtransfer.hh index 6ca2a0097a2a193f8566d151d424494fb4ff5f75..2af47947b5da22ffca134684ed65f7dccecd692c 100644 --- a/dune/solvers/transferoperators/truncatedmgtransfer.hh +++ b/dune/solvers/transferoperators/truncatedmgtransfer.hh @@ -22,7 +22,7 @@ template< class BitVectorType = Dune::BitSetVector<VectorType::block_type::dimension>, class MatrixType = Dune::BCRSMatrix< typename Dune::FieldMatrix< typename VectorType::field_type, VectorType::block_type::dimension, VectorType::block_type::dimension> > > -class TruncatedMGTransfer +class TruncatedMGTransfer : virtual public MultigridTransfer<VectorType, BitVectorType, MatrixType> { enum {blocksize = VectorType::block_type::dimension}; @@ -32,31 +32,19 @@ class TruncatedMGTransfer public: /** \brief Default constructor */ - TruncatedMGTransfer() : recompute_(NULL) - {} + TruncatedMGTransfer() : recompute_(nullptr), critical_(nullptr) {} - /** \brief Restrict level fL of f and store the result in level cL of t - * - * \param critical Has to contain an entry for each degree of freedom. - * Those dofs with a set bit are treated as critical. - */ - virtual void restrict(const VectorType& f, VectorType &t, const BitVectorType& critical) const = 0; - - /** \brief Prolong level cL of f and store the result in level fL of t - * - * \param critical Has to contain an entry for each degree of freedom. - * Those dofs with a set bit are treated as critical. - */ - virtual void prolong(const VectorType& f, VectorType &t, const BitVectorType& critical) const = 0; + /** \brief Set recompute bitfield. */ + void setRecomputeBitField(const Dune::BitSetVector<1>* recompute) + { + recompute_ = recompute; + } - /** \brief Galerkin assemble a coarse stiffness matrix - * - * \param critical Has to contain an entry for each degree of freedom. - * Those dofs with a set bit are treated as critical. - */ - virtual void galerkinRestrict(const MatrixType& fineMat, - MatrixType& coarseMat, - const BitVectorType& critical) const = 0; + /** \brief Set critical bitfield. */ + void setCriticalBitField(const BitVectorType* critical) + { + critical_ = critical; + } /** \brief Bitfield specifying a subset of dofs which need to be recomputed * when doing Galerkin restriction @@ -68,6 +56,12 @@ public: * on the problem this can lead to considerable time savings. */ const Dune::BitSetVector<1>* recompute_; + + /** + * \brief Has to contain an entry for each degree of freedom. + * Those dofs with a set bit are treated as critical. + */ + const BitVectorType* critical_; }; #endif