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
82e31774
There was a problem fetching the pipeline summary.
Commit
82e31774
authored
7 years ago
by
Max Kahnt
Browse files
Options
Downloads
Patches
Plain Diff
Allow proper usage without implicitly required DefaultBitVectorType.
parent
e16d43f2
Branches
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#
Changes
2
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dune/solvers/iterationsteps/multigridstep.cc
+4
-3
4 additions, 3 deletions
dune/solvers/iterationsteps/multigridstep.cc
dune/solvers/iterationsteps/multigridstep.hh
+16
-15
16 additions, 15 deletions
dune/solvers/iterationsteps/multigridstep.hh
with
20 additions
and
18 deletions
dune/solvers/iterationsteps/multigridstep.cc
+
4
−
3
View file @
82e31774
...
...
@@ -138,6 +138,8 @@ void MultigridStep<MatrixType, VectorType, BitVectorType>::preprocess()
// Set up base solver
// /////////////////////////////////////////////
using
SmootherType
=
LinearIterationStep
<
MatrixType
,
VectorType
,
BitVectorType
>
;
using
LinearSolverType
=
LinearSolver
<
MatrixType
,
VectorType
,
BitVectorType
>
;
if
(
basesolver_
)
{
// If the base solver can ignore dofs give it the ignoreNodes field
...
...
@@ -150,16 +152,15 @@ void MultigridStep<MatrixType, VectorType, BitVectorType>::preprocess()
DuneSolversLoopSolver
*
loopBaseSolver
=
dynamic_cast
<
DuneSolversLoopSolver
*>
(
this
->
basesolver_
.
get
());
typedef
LinearIterationStep
<
MatrixType
,
VectorType
>
SmootherType
;
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
]);
}
else
if
(
dynamic_cast
<
LinearSolver
<
MatrixType
,
VectorType
>
*>
(
this
->
basesolver_
.
get
()))
{
else
if
(
dynamic_cast
<
LinearSolver
Type
*>
(
this
->
basesolver_
.
get
()))
{
LinearSolver
<
MatrixType
,
VectorType
>
*
linearBaseSolver
=
dynamic_cast
<
LinearSolver
<
MatrixType
,
VectorType
>
*>
(
this
->
basesolver_
.
get
());
LinearSolver
Type
*
linearBaseSolver
=
dynamic_cast
<
LinearSolver
Type
*>
(
this
->
basesolver_
.
get
());
linearBaseSolver
->
setProblem
(
*
(
this
->
matrixHierarchy_
[
0
]),
*
this
->
xHierarchy_
[
0
],
this
->
rhsHierarchy_
[
0
]);
}
...
...
This diff is collapsed.
Click to expand it.
dune/solvers/iterationsteps/multigridstep.hh
+
16
−
15
View file @
82e31774
...
...
@@ -28,6 +28,7 @@ namespace Dune {
static
const
int
blocksize
=
VectorType
::
block_type
::
dimension
;
public:
using
LinearStepType
=
LinearIterationStep
<
MatrixType
,
VectorType
,
BitVectorType
>
;
MultigridStep
()
:
presmoother_
(
0
),
...
...
@@ -41,11 +42,11 @@ namespace Dune {
VectorType
&
x
,
const
VectorType
&
rhs
,
int
mu
,
int
nu1
,
int
nu2
,
Linear
IterationStep
<
MatrixType
,
VectorType
>
*
preSmoother
,
Linear
IterationStep
<
MatrixType
,
VectorType
>
*
postSmoother
,
Linear
StepType
*
preSmoother
,
Linear
StepType
*
postSmoother
,
Solver
*
baseSolver
,
const
BitVectorType
*
ignoreNodes
)
:
Linear
IterationStep
<
MatrixType
,
VectorType
>
(
mat
,
x
,
rhs
),
Linear
StepType
(
mat
,
x
,
rhs
),
preprocessCalled
(
false
)
{
mu_
=
mu
;
...
...
@@ -62,7 +63,7 @@ namespace Dune {
MultigridStep
(
const
MatrixType
&
mat
,
VectorType
&
x
,
const
VectorType
&
rhs
)
:
Linear
IterationStep
<
MatrixType
,
VectorType
>
(
mat
,
x
,
rhs
),
Linear
StepType
(
mat
,
x
,
rhs
),
basesolver_
(
0
),
preprocessCalled
(
false
)
{}
...
...
@@ -143,7 +144,7 @@ namespace Dune {
virtual
void
setMGType
(
int
mu
,
int
nu1
,
int
nu2
);
/** \brief Set the smoother iteration step */
virtual
void
setSmoother
(
Linear
IterationStep
<
MatrixType
,
VectorType
>
*
smoother
)
virtual
void
setSmoother
(
Linear
StepType
*
smoother
)
{
presmootherDefault_
=
postsmootherDefault_
=
Dune
::
stackobject_to_shared_ptr
(
*
smoother
);
...
...
@@ -151,7 +152,7 @@ namespace Dune {
}
/** \brief Set the smoother iteration step from a smart pointer*/
virtual
void
setSmoother
(
std
::
shared_ptr
<
Linear
IterationStep
<
MatrixType
,
VectorType
>
>
smoother
)
virtual
void
setSmoother
(
std
::
shared_ptr
<
Linear
StepType
>
smoother
)
{
presmootherDefault_
=
postsmootherDefault_
=
smoother
;
...
...
@@ -159,8 +160,8 @@ namespace Dune {
}
/** \brief Set pre- and post smoothers individually */
virtual
void
setSmoother
(
Linear
IterationStep
<
MatrixType
,
VectorType
>
*
preSmoother
,
Linear
IterationStep
<
MatrixType
,
VectorType
>
*
postSmoother
)
virtual
void
setSmoother
(
Linear
StepType
*
preSmoother
,
Linear
StepType
*
postSmoother
)
{
presmootherDefault_
=
Dune
::
stackobject_to_shared_ptr
(
*
preSmoother
);
postsmootherDefault_
=
Dune
::
stackobject_to_shared_ptr
(
*
postSmoother
);
...
...
@@ -169,13 +170,13 @@ namespace Dune {
}
/** \brief Set the smoother iteration step for a particular level */
virtual
void
setSmoother
(
Linear
IterationStep
<
MatrixType
,
VectorType
>
*
smoother
,
std
::
size_t
level
)
virtual
void
setSmoother
(
Linear
StepType
*
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
<
Linear
IterationStep
<
MatrixType
,
VectorType
>
>
smoother
,
std
::
size_t
level
)
virtual
void
setSmoother
(
std
::
shared_ptr
<
Linear
StepType
>
smoother
,
std
::
size_t
level
)
{
levelWiseSmoothers_
[
level
]
=
smoother
;
}
...
...
@@ -189,10 +190,10 @@ namespace Dune {
protected
:
/** \brief The presmoothers, one for each level */
std
::
vector
<
std
::
shared_ptr
<
Linear
IterationStep
<
MatrixType
,
VectorType
>
>
>
presmoother_
;
std
::
vector
<
std
::
shared_ptr
<
Linear
StepType
>
>
presmoother_
;
/** \brief The postsmoothers, one for each level */
std
::
vector
<
std
::
shared_ptr
<
Linear
IterationStep
<
MatrixType
,
VectorType
>
>
>
postsmoother_
;
std
::
vector
<
std
::
shared_ptr
<
Linear
StepType
>
>
postsmoother_
;
/** \brief The base solver */
std
::
shared_ptr
<
Solver
>
basesolver_
;
...
...
@@ -230,9 +231,9 @@ namespace Dune {
protected
:
std
::
shared_ptr
<
Linear
IterationStep
<
MatrixType
,
VectorType
>
>
presmootherDefault_
;
std
::
shared_ptr
<
Linear
IterationStep
<
MatrixType
,
VectorType
>
>
postsmootherDefault_
;
typedef
std
::
map
<
std
::
size_t
,
std
::
shared_ptr
<
Linear
IterationStep
<
MatrixType
,
VectorType
>
>
>
SmootherCache
;
std
::
shared_ptr
<
Linear
StepType
>
presmootherDefault_
;
std
::
shared_ptr
<
Linear
StepType
>
postsmootherDefault_
;
typedef
std
::
map
<
std
::
size_t
,
std
::
shared_ptr
<
Linear
StepType
>
>
SmootherCache
;
SmootherCache
levelWiseSmoothers_
;
bool
preprocessCalled
;
...
...
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