Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-solvers
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
agnumpde
dune-solvers
Commits
429ed84d
Commit
429ed84d
authored
6 years ago
by
Jonathan Youett
Browse files
Options
Downloads
Patches
Plain Diff
Make setSmoother non-virtual and work for l-value, r-values and shared_ptr
parent
7f1f56a1
No related branches found
No related tags found
1 merge request
!26
Feature/multigridstep rework set smoother
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/solvers/iterationsteps/multigridstep.hh
+11
-10
11 additions, 10 deletions
dune/solvers/iterationsteps/multigridstep.hh
with
11 additions
and
10 deletions
dune/solvers/iterationsteps/multigridstep.hh
+
11
−
10
View file @
429ed84d
...
...
@@ -160,10 +160,11 @@ namespace Dune {
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
();
}
...
...
@@ -178,11 +179,10 @@ 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
();
}
...
...
@@ -194,9 +194,10 @@ namespace Dune {
}
/** \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 */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment