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
5765f031
Commit
5765f031
authored
4 years ago
by
Ansgar Burchardt
Browse files
Options
Downloads
Patches
Plain Diff
multigridstep.cc: avoid repeating dynamic casts
parent
6db38832
No related branches found
No related tags found
1 merge request
!43
Minor cleanup
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/solvers/iterationsteps/multigridstep.cc
+8
-15
8 additions, 15 deletions
dune/solvers/iterationsteps/multigridstep.cc
with
8 additions
and
15 deletions
dune/solvers/iterationsteps/multigridstep.cc
+
8
−
15
View file @
5765f031
...
...
@@ -156,25 +156,18 @@ void MultigridStep<MatrixType, VectorType, BitVectorType>::preprocess()
if
(
basesolver_
)
{
// If the base solver can ignore dofs give it the ignoreNodes field
if
(
dynamic
_cast
<
CanIgnore
<
BitVectorType
>
*
>
(
this
->
basesolver_
.
get
()
))
dynamic_cast
<
CanIgnore
<
BitVectorType
>*>
(
this
->
basesolver_
.
get
())
->
setIgnore
(
*
ignoreNodesHierarchy_
[
0
]);
if
(
auto
canIgnore
=
std
::
dynamic_pointer
_cast
<
CanIgnore
<
BitVectorType
>
>
(
this
->
basesolver_
))
canIgnore
->
setIgnore
(
*
ignoreNodesHierarchy_
[
0
]);
typedef
::
LoopSolver
<
VectorType
>
DuneSolversLoopSolver
;
if
(
dynamic_cast
<
DuneSolversLoopSolver
*>
(
this
->
basesolver_
.
get
()))
{
DuneSolversLoopSolver
*
loopBaseSolver
=
dynamic_cast
<
DuneSolversLoopSolver
*>
(
this
->
basesolver_
.
get
());
assert
(
dynamic_cast
<
SmootherType
*>
(
&
loopBaseSolver
->
getIterationStep
()));
dynamic_cast
<
SmootherType
*>
(
&
loopBaseSolver
->
getIterationStep
())
->
setProblem
(
*
(
this
->
matrixHierarchy_
[
0
]),
*
this
->
xHierarchy_
[
0
],
this
->
rhsHierarchy_
[
0
]);
dynamic_cast
<
SmootherType
*>
(
&
loopBaseSolver
->
getIterationStep
())
->
setIgnore
(
*
ignoreNodesHierarchy_
[
0
]);
if
(
auto
loopBaseSolver
=
std
::
dynamic_pointer_cast
<
DuneSolversLoopSolver
>
(
this
->
basesolver_
))
{
auto
iterationStep
=
dynamic_cast
<
SmootherType
*>
(
&
loopBaseSolver
->
getIterationStep
());
assert
(
iterationStep
);
iterationStep
->
setProblem
(
*
(
this
->
matrixHierarchy_
[
0
]),
*
this
->
xHierarchy_
[
0
],
this
->
rhsHierarchy_
[
0
]);
iterationStep
->
setIgnore
(
*
ignoreNodesHierarchy_
[
0
]);
}
else
if
(
dynamic_cast
<
LinearSolverType
*>
(
this
->
basesolver_
.
get
()))
{
LinearSolverType
*
linearBaseSolver
=
dynamic_cast
<
LinearSolverType
*>
(
this
->
basesolver_
.
get
());
else
if
(
auto
linearBaseSolver
=
std
::
dynamic_pointer_cast
<
LinearSolverType
>
(
this
->
basesolver_
))
{
linearBaseSolver
->
setProblem
(
*
(
this
->
matrixHierarchy_
[
0
]),
*
this
->
xHierarchy_
[
0
],
this
->
rhsHierarchy_
[
0
]);
}
else
{
...
...
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