Skip to content
Snippets Groups Projects
Commit 04ef26fa authored by akbib's avatar akbib
Browse files

Merge branch 'feature/multigridstep_rework_set_smoother' into 'master'

Feature/multigridstep rework set smoother

See merge request !26
parents 299a8fa2 cf9d872e
No related branches found
No related tags found
1 merge request!26Feature/multigridstep rework set smoother
Pipeline #12265 failed
......@@ -153,24 +153,27 @@ namespace Dune {
virtual void setMGType(int mu, int nu1, int nu2);
/** \brief Set the smoother iteration step */
virtual void setSmoother(LinearStepType* smoother)
DUNE_DEPRECATED_MSG("Consider setting the smoother via smart pointer, reference or temporaries instead.")
void setSmoother(LinearStepType* smoother)
{
presmootherDefault_ = postsmootherDefault_ = Dune::stackobject_to_shared_ptr(*smoother);
levelWiseSmoothers_.clear();
}
/** \brief Set the smoother iteration step from a smart pointer*/
virtual void setSmoother(std::shared_ptr<LinearStepType> smoother)
/** \brief Set the smoother iteration step from a smart pointer, reference or temporary*/
template <class Smoother, class = std::enable_if_t<not std::is_pointer<Smoother>::value> >
void setSmoother(Smoother&& smoother)
{
presmootherDefault_ = postsmootherDefault_ = smoother;
presmootherDefault_ = postsmootherDefault_ = wrap_own_share<LinearStepType>(std::forward<Smoother>(smoother));
levelWiseSmoothers_.clear();
}
/** \brief Set pre- and post smoothers individually */
virtual void setSmoother(LinearStepType* preSmoother,
LinearStepType* postSmoother)
DUNE_DEPRECATED_MSG("Consider setting the smoother via smart pointer, reference or temporaries instead.")
void setSmoother(LinearStepType* preSmoother,
LinearStepType* postSmoother)
{
presmootherDefault_ = Dune::stackobject_to_shared_ptr(*preSmoother);
postsmootherDefault_ = Dune::stackobject_to_shared_ptr(*postSmoother);
......@@ -178,25 +181,26 @@ namespace Dune {
levelWiseSmoothers_.clear();
}
virtual void setSmoother(std::shared_ptr<LinearStepType> preSmoother,
std::shared_ptr<LinearStepType> postSmoother)
{
presmootherDefault_ = std::move(preSmoother);
postsmootherDefault_ = std::move(postSmoother);
template <class Smoother, class = std::enable_if_t<not std::is_pointer<Smoother>::value> >
void setSmoother(Smoother&& preSmoother, Smoother&& postSmoother) {
presmootherDefault_ = wrap_own_share<LinearStepType>(std::forward<Smoother>(preSmoother));
postsmootherDefault_ = wrap_own_share<LinearStepType>(std::forward<Smoother>(postSmoother));
levelWiseSmoothers_.clear();
}
/** \brief Set the smoother iteration step for a particular level */
virtual void setSmoother(LinearStepType* smoother, std::size_t level)
DUNE_DEPRECATED_MSG("Consider setting the smoother via smart pointer, reference or temporaries instead.")
void setSmoother(LinearStepType* smoother, std::size_t level)
{
levelWiseSmoothers_[level] = Dune::stackobject_to_shared_ptr(*smoother);
}
/** \brief Set the smoother iteration step for a particular level, from a smart pointer */
virtual void setSmoother(std::shared_ptr<LinearStepType> smoother, std::size_t level)
template <class Smoother, class = std::enable_if_t<not std::is_pointer<Smoother>::value> >
void setSmoother(Smoother&& smoother, std::size_t level)
{
levelWiseSmoothers_[level] = smoother;
levelWiseSmoothers_[level] = wrap_own_share<LinearStepType>(std::forward<Smoother>(smoother));
}
/** \brief Set base solver */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment