diff --git a/dune/solvers/iterationsteps/multigridstep.hh b/dune/solvers/iterationsteps/multigridstep.hh index a4b54d16909b5b2fc1b3982614b95a0a52cb3eba..36231844a5de53c01b502da1f1188b6aa20d579c 100644 --- a/dune/solvers/iterationsteps/multigridstep.hh +++ b/dune/solvers/iterationsteps/multigridstep.hh @@ -173,6 +173,12 @@ presmoother_[i] = postsmoother_[i] = Dune::stackobject_to_shared_ptr(*smoother); } + /** \brief Set the smoother iteration step from a smart pointer*/ + virtual void setSmoother(Dune::shared_ptr<LinearIterationStep<MatrixType, VectorType> > smoother) { + for (size_t i=0; i<presmoother_.size(); i++) + presmoother_[i] = postsmoother_[i] = smoother; + } + /** \brief Set pre- and post smoothers individually */ virtual void setSmoother(LinearIterationStep<MatrixType, VectorType>* preSmoother, LinearIterationStep<MatrixType, VectorType>* postSmoother) { @@ -188,6 +194,12 @@ presmoother_[level] = postsmoother_[level] = Dune::stackobject_to_shared_ptr(*smoother); } + /** \brief Set the smoother iteration step for a particular level, from a smart pointer */ + virtual void setSmoother(Dune::shared_ptr<LinearIterationStep<MatrixType, VectorType> > smoother, + int level) { + presmoother_[level] = postsmoother_[level] = smoother; + } + protected: /** \brief The presmoothers, one for each level */ std::vector<Dune::shared_ptr<LinearIterationStep<MatrixType, VectorType> > > presmoother_;