Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-istl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Stephan Hilb
dune-istl
Commits
3c7db109
Commit
3c7db109
authored
9 years ago
by
Christian Engwer
Browse files
Options
Downloads
Patches
Plain Diff
[kamg] add new constructors, compatible with the new constructors of the amg
parent
cac6f96d
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dune/istl/paamg/kamg.hh
+59
-3
59 additions, 3 deletions
dune/istl/paamg/kamg.hh
dune/istl/paamg/test/kamgtest.cc
+1
-1
1 addition, 1 deletion
dune/istl/paamg/test/kamgtest.cc
with
60 additions
and
4 deletions
dune/istl/paamg/kamg.hh
+
59
−
3
View file @
3c7db109
...
@@ -179,8 +179,23 @@ namespace Dune
...
@@ -179,8 +179,23 @@ namespace Dune
*/
*/
KAMG
(
const
OperatorHierarchy
&
matrices
,
CoarseSolver
&
coarseSolver
,
KAMG
(
const
OperatorHierarchy
&
matrices
,
CoarseSolver
&
coarseSolver
,
const
SmootherArgs
&
smootherArgs
,
std
::
size_t
gamma
,
const
SmootherArgs
&
smootherArgs
,
std
::
size_t
gamma
,
std
::
size_t
preSmoothingSteps
=
1
,
std
::
size_t
postSmoothingSteps
=
1
,
std
::
size_t
preSmoothingSteps
=
1
,
std
::
size_t
postSmoothingSteps
=
1
,
std
::
size_t
maxLevelKrylovSteps
=
3
,
double
minDefectReduction
=
1e-1
);
std
::
size_t
maxLevelKrylovSteps
=
3
,
double
minDefectReduction
=
1e-1
)
DUNE_DEPRECATED
;
/**
* @brief Construct a new amg with a specific coarse solver.
* @param matrices The already set up matix hierarchy.
* @param coarseSolver The set up solver to use on the coarse
* grid, must match the coarse matrix in the matrix hierachy.
* @param smootherArgs The arguments needed for thesmoother to use
* for pre and post smoothing.
* @param parms The parameters for the AMG.
* @param maxLevelKrylovSteps maximum of krylov iterations on a particular level (default=3)
* @param minDefectReduction minimal defect reduction during the krylov iterations on a particular level (default=1e-1)
*/
KAMG
(
const
OperatorHierarchy
&
matrices
,
CoarseSolver
&
coarseSolver
,
const
SmootherArgs
&
smootherArgs
,
const
Parameters
&
parms
,
std
::
size_t
maxLevelKrylovSteps
=
3
,
double
minDefectReduction
=
1e-1
);
/**
/**
* @brief Construct an AMG with an inexact coarse solver based on the smoother.
* @brief Construct an AMG with an inexact coarse solver based on the smoother.
...
@@ -197,12 +212,35 @@ namespace Dune
...
@@ -197,12 +212,35 @@ namespace Dune
* @param maxLevelKrylovSteps The maximum number of Krylov steps allowed at each level.
* @param maxLevelKrylovSteps The maximum number of Krylov steps allowed at each level.
* @param minDefectReduction The defect reduction to achieve on each krylov level.
* @param minDefectReduction The defect reduction to achieve on each krylov level.
* @param pinfo The information about the parallel distribution of the data.
* @param pinfo The information about the parallel distribution of the data.
* @deprecated Use
* KAMG(const Operator&, const C&, const SmootherArgs, const ParallelInformation)
* instead.
* All parameters can be set in the criterion!
*/
*/
template
<
class
C
>
template
<
class
C
>
KAMG
(
const
Operator
&
fineOperator
,
const
C
&
criterion
,
KAMG
(
const
Operator
&
fineOperator
,
const
C
&
criterion
,
const
SmootherArgs
&
smootherArgs
,
std
::
size_t
gamma
=
1
,
const
SmootherArgs
&
smootherArgs
,
std
::
size_t
gamma
,
std
::
size_t
preSmoothingSteps
=
1
,
std
::
size_t
postSmoothingSteps
=
1
,
std
::
size_t
preSmoothingSteps
=
1
,
std
::
size_t
postSmoothingSteps
=
1
,
std
::
size_t
maxLevelKrylovSteps
=
3
,
double
minDefectReduction
=
1e-1
,
std
::
size_t
maxLevelKrylovSteps
=
3
,
double
minDefectReduction
=
1e-1
,
const
ParallelInformation
&
pinfo
=
ParallelInformation
())
DUNE_DEPRECATED
;
/**
* @brief Construct an AMG with an inexact coarse solver based on the smoother.
*
* As coarse solver a preconditioned CG method with the smoother as preconditioner
* will be used. The matrix hierarchy is built automatically.
* @param fineOperator The operator on the fine level.
* @param criterion The criterion describing the coarsening strategy. E. g. SymmetricCriterion
* or UnsymmetricCriterion, and providing the parameters.
* @param smootherArgs The arguments for constructing the smoothers.
* @param maxLevelKrylovSteps maximum of krylov iterations on a particular level (default=3)
* @param minDefectReduction minimal defect reduction during the krylov iterations on a particular level (default=1e-1)
* @param pinfo The information about the parallel distribution of the data.
*/
template
<
class
C
>
KAMG
(
const
Operator
&
fineOperator
,
const
C
&
criterion
,
const
SmootherArgs
&
smootherArgs
=
SmootherArgs
(),
std
::
size_t
maxLevelKrylovSteps
=
3
,
double
minDefectReduction
=
1e-1
,
const
ParallelInformation
&
pinfo
=
ParallelInformation
());
const
ParallelInformation
&
pinfo
=
ParallelInformation
());
/** \copydoc Preconditioner::pre(X&,Y&) */
/** \copydoc Preconditioner::pre(X&,Y&) */
...
@@ -241,6 +279,14 @@ namespace Dune
...
@@ -241,6 +279,14 @@ namespace Dune
postSmoothingSteps
),
maxLevelKrylovSteps
(
ksteps
),
levelDefectReduction
(
reduction
)
postSmoothingSteps
),
maxLevelKrylovSteps
(
ksteps
),
levelDefectReduction
(
reduction
)
{}
{}
template
<
class
M
,
class
X
,
class
S
,
class
P
,
class
K
,
class
A
>
KAMG
<
M
,
X
,
S
,
P
,
K
,
A
>::
KAMG
(
const
OperatorHierarchy
&
matrices
,
CoarseSolver
&
coarseSolver
,
const
SmootherArgs
&
smootherArgs
,
const
Parameters
&
params
,
std
::
size_t
ksteps
,
double
reduction
)
:
amg
(
matrices
,
coarseSolver
,
smootherArgs
,
params
),
maxLevelKrylovSteps
(
ksteps
),
levelDefectReduction
(
reduction
)
{}
template
<
class
M
,
class
X
,
class
S
,
class
P
,
class
K
,
class
A
>
template
<
class
M
,
class
X
,
class
S
,
class
P
,
class
K
,
class
A
>
template
<
class
C
>
template
<
class
C
>
KAMG
<
M
,
X
,
S
,
P
,
K
,
A
>::
KAMG
(
const
Operator
&
fineOperator
,
const
C
&
criterion
,
KAMG
<
M
,
X
,
S
,
P
,
K
,
A
>::
KAMG
(
const
Operator
&
fineOperator
,
const
C
&
criterion
,
...
@@ -252,6 +298,16 @@ namespace Dune
...
@@ -252,6 +298,16 @@ namespace Dune
postSmoothingSteps
,
false
,
pinfo
),
maxLevelKrylovSteps
(
ksteps
),
levelDefectReduction
(
reduction
)
postSmoothingSteps
,
false
,
pinfo
),
maxLevelKrylovSteps
(
ksteps
),
levelDefectReduction
(
reduction
)
{}
{}
template
<
class
M
,
class
X
,
class
S
,
class
P
,
class
K
,
class
A
>
template
<
class
C
>
KAMG
<
M
,
X
,
S
,
P
,
K
,
A
>::
KAMG
(
const
Operator
&
fineOperator
,
const
C
&
criterion
,
const
SmootherArgs
&
smootherArgs
,
std
::
size_t
ksteps
,
double
reduction
,
const
ParallelInformation
&
pinfo
)
:
amg
(
fineOperator
,
criterion
,
smootherArgs
,
pinfo
),
maxLevelKrylovSteps
(
ksteps
),
levelDefectReduction
(
reduction
)
{}
template
<
class
M
,
class
X
,
class
S
,
class
P
,
class
K
,
class
A
>
template
<
class
M
,
class
X
,
class
S
,
class
P
,
class
K
,
class
A
>
void
KAMG
<
M
,
X
,
S
,
P
,
K
,
A
>::
pre
(
Domain
&
x
,
Range
&
b
)
void
KAMG
<
M
,
X
,
S
,
P
,
K
,
A
>::
pre
(
Domain
&
x
,
Range
&
b
)
...
...
This diff is collapsed.
Click to expand it.
dune/istl/paamg/test/kamgtest.cc
+
1
−
1
View file @
3c7db109
...
@@ -96,7 +96,7 @@ void testAMG(int N, int coarsenTarget, int ml)
...
@@ -96,7 +96,7 @@ void testAMG(int N, int coarsenTarget, int ml)
Dune
::
SeqScalarProduct
<
Vector
>
sp
;
Dune
::
SeqScalarProduct
<
Vector
>
sp
;
typedef
Dune
::
Amg
::
KAMG
<
Operator
,
Vector
,
Smoother
,
Dune
::
Amg
::
SequentialInformation
>
AMG
;
typedef
Dune
::
Amg
::
KAMG
<
Operator
,
Vector
,
Smoother
,
Dune
::
Amg
::
SequentialInformation
>
AMG
;
AMG
amg
(
fop
,
criterion
,
smootherArgs
,
1
,
1
,
1
);
AMG
amg
(
fop
,
criterion
,
smootherArgs
);
double
buildtime
=
watch
.
elapsed
();
double
buildtime
=
watch
.
elapsed
();
...
...
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