From 9fdfba4a7166861900a8da96ca29624b0cbe2c37 Mon Sep 17 00:00:00 2001
From: Oliver Sander <sander@igpm.rwth-aachen.de>
Date: Fri, 22 Jun 2012 16:36:19 +0000
Subject: [PATCH] add methods to set smoothers from smart pointers

[[Imported from SVN: r6429]]
---
 dune/solvers/iterationsteps/multigridstep.hh | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/dune/solvers/iterationsteps/multigridstep.hh b/dune/solvers/iterationsteps/multigridstep.hh
index a4b54d16..36231844 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_;
-- 
GitLab