Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
dumux-repositories
dumux
Commits
f51c2af5
Commit
f51c2af5
authored
Nov 02, 2017
by
Timo Koch
Browse files
[amg] Derive from linear solver param interface
parent
731fd190
Changes
1
Hide whitespace changes
Inline
Side-by-side
dumux/linear/amgbackend.hh
View file @
f51c2af5
...
...
@@ -31,6 +31,7 @@
#include
<dune/istl/paamg/pinfo.hh>
#include
<dune/istl/solvers.hh>
#include
<dumux/linear/solver.hh>
#include
<dumux/linear/linearsolverproperties.hh>
#include
<dumux/linear/amgproperties.hh>
#include
<dumux/linear/amgparallelhelpers.hh>
...
...
@@ -71,7 +72,7 @@ void scaleLinearSystem(Matrix& matrix, Vector& rhs)
* \brief Provides a linear solver using the ISTL AMG.
*/
template
<
class
TypeTag
>
class
AMGBackend
class
AMGBackend
:
public
LinearSolver
<
TypeTag
>
{
using
GridView
=
typename
GET_PROP_TYPE
(
TypeTag
,
GridView
);
using
Grid
=
typename
GET_PROP_TYPE
(
TypeTag
,
Grid
);
...
...
@@ -109,11 +110,6 @@ public:
template
<
class
Matrix
,
class
Vector
>
bool
solve
(
Matrix
&
A
,
Vector
&
x
,
Vector
&
b
)
{
static
const
auto
modelParamGroup
=
GET_PROP_VALUE
(
TypeTag
,
ModelParameterGroup
);
static
const
int
verbosity
=
getParamFromGroup
<
int
>
(
modelParamGroup
,
"LinearSolver.Verbosity"
);
static
const
int
maxIter
=
getParamFromGroup
<
int
>
(
modelParamGroup
,
"LinearSolver.MaxIterations"
);
static
const
double
residReduction
=
getParamFromGroup
<
double
>
(
modelParamGroup
,
"LinearSolver.ResidualReduction"
);
int
rank
=
0
;
std
::
shared_ptr
<
Comm
>
comm
;
std
::
shared_ptr
<
LinearOperator
>
fop
;
...
...
@@ -128,15 +124,15 @@ public:
//! \todo Check whether the default accumulation mode atOnceAccu is needed.
Dune
::
Amg
::
Parameters
params
(
15
,
2000
,
1.2
,
1.6
,
Dune
::
Amg
::
atOnceAccu
);
params
.
setDefaultValuesIsotropic
(
Grid
::
dimension
);
params
.
setDebugLevel
(
verbosity
);
params
.
setDebugLevel
(
this
->
verbosity
()
);
Criterion
criterion
(
params
);
SmootherArgs
smootherArgs
;
smootherArgs
.
iterations
=
1
;
smootherArgs
.
relaxationFactor
=
1
;
AMGType
amg
(
*
fop
,
criterion
,
smootherArgs
,
*
comm
);
Dune
::
BiCGSTABSolver
<
VType
>
solver
(
*
fop
,
*
sp
,
amg
,
residReduction
,
maxIter
,
rank
==
0
?
verbosity
:
0
);
Dune
::
BiCGSTABSolver
<
VType
>
solver
(
*
fop
,
*
sp
,
amg
,
this
->
residReduction
(),
this
->
maxIter
()
,
rank
==
0
?
this
->
verbosity
()
:
0
);
solver
.
apply
(
x
,
b
,
result_
);
firstCall_
=
false
;
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment