Skip to content
Snippets Groups Projects
Commit 5025cb8e authored by Jonathan Youett's avatar Jonathan Youett
Browse files

Use wrap_move_share to extend the setter to l-value and r-values

parent 83db8cea
No related branches found
No related tags found
1 merge request!15Reduce raw pointer
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <dune/solvers/transferoperators/multigridtransfer.hh> #include <dune/solvers/transferoperators/multigridtransfer.hh>
#include <dune/solvers/common/boxconstraint.hh> #include <dune/solvers/common/boxconstraint.hh>
#include <dune/solvers/common/wrapownshare.hh>
#include <dune/solvers/transferoperators/obstaclerestrictor.hh> #include <dune/solvers/transferoperators/obstaclerestrictor.hh>
/** \brief The general monotone multigrid solver /** \brief The general monotone multigrid solver
...@@ -59,8 +60,9 @@ public: ...@@ -59,8 +60,9 @@ public:
void setObstacles(ObstacleVectorType* obstacles) {obstacles_ = obstacles;} void setObstacles(ObstacleVectorType* obstacles) {obstacles_ = obstacles;}
//! Set the obstacle restrictor //! Set the obstacle restrictor
void setObstacleRestrictor(std::shared_ptr<ObstacleRestrictor<VectorType> > restrictor) { template <class Restrictor>
obstacleRestrictor_ = restrictor; void setObstacleRestrictor(Restrictor&& restrictor) {
obstacleRestrictor_ = Dune::Solvers::wrap_own_share<ObstacleRestrictor<VectorType> >(std::forward<Restrictor>(restrictor));
} }
//! Bitfield determining which fine grid nodes have an obstacle //! Bitfield determining which fine grid nodes have an obstacle
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment