Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dumux
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
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
dumux-repositories
dumux
Commits
5bb66250
Commit
5bb66250
authored
5 years ago
by
Timo Koch
Browse files
Options
Downloads
Patches
Plain Diff
[params][solver] Deprecate oldstyle preconditioner parameters
parent
bb0a9d29
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1890
Feature/deprecate old preconditioner params
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dumux/linear/solver.hh
+38
-6
38 additions, 6 deletions
dumux/linear/solver.hh
with
38 additions
and
6 deletions
dumux/linear/solver.hh
+
38
−
6
View file @
5bb66250
...
...
@@ -46,9 +46,9 @@ public:
* - LinearSolver.Verbosity the verbosity level of the linear solver
* - LinearSolver.MaxIterations the maximum iterations of the solver
* - LinearSolver.ResidualReduction the residual reduction threshold, i.e. stopping criterion
* - LinearSolver.PreconditionerRelaxation precondition relaxation
* - LinearSolver.PreconditionerIterations the number of preconditioner iterations
* - LinearSolver.PreconditionerVerbosity the preconditioner verbosity level
* - LinearSolver.Preconditioner
.
Relaxation precondition relaxation
* - LinearSolver.Preconditioner
.
Iterations the number of preconditioner iterations
* - LinearSolver.Preconditioner
.
Verbosity the preconditioner verbosity level
*/
LinearSolver
(
const
std
::
string
&
paramGroup
=
""
)
:
paramGroup_
(
paramGroup
)
...
...
@@ -56,9 +56,41 @@ public:
verbosity_
=
getParamFromGroup
<
int
>
(
paramGroup
,
"LinearSolver.Verbosity"
,
0
);
maxIter_
=
getParamFromGroup
<
int
>
(
paramGroup
,
"LinearSolver.MaxIterations"
,
250
);
residReduction_
=
getParamFromGroup
<
double
>
(
paramGroup
,
"LinearSolver.ResidualReduction"
,
1e-13
);
relaxation_
=
getParamFromGroup
<
double
>
(
paramGroup
,
"LinearSolver.PreconditionerRelaxation"
,
1
);
precondIter_
=
getParamFromGroup
<
int
>
(
paramGroup
,
"LinearSolver.PreconditionerIterations"
,
1
);
precondVerbosity_
=
getParamFromGroup
<
int
>
(
paramGroup
,
"LinearSolver.PreconditionerVerbosity"
,
0
);
// for deprecation period we ask also for the "old" parameters but print a warning
// the "new" style parameter takes precedence
// TODO: Remove all this code after 3.2 and use commented code below
if
(
hasParamInGroup
(
paramGroup
,
"LinearSolver.PreconditionerRelaxation"
))
{
std
::
cerr
<<
"Deprecation warning: parameter LinearSolver.PreconditionerRelaxation is deprecated and will be removed after 3.2. "
<<
"Use LinearSolver.Preconditioner.Relaxation instead (Preconditioner subgroup)."
<<
std
::
endl
;
relaxation_
=
getParamFromGroup
<
double
>
(
paramGroup
,
"LinearSolver.PreconditionerRelaxation"
);
}
else
relaxation_
=
getParamFromGroup
<
double
>
(
paramGroup
,
"LinearSolver.Preconditioner.Relaxation"
,
1
);
if
(
hasParamInGroup
(
paramGroup
,
"LinearSolver.PreconditionerIterations"
))
{
std
::
cerr
<<
"Deprecation warning: parameter LinearSolver.PreconditionerIterations is deprecated and will be removed after 3.2. "
<<
"Use LinearSolver.Preconditioner.Iterations instead (Preconditioner subgroup)."
<<
std
::
endl
;
precondIter_
=
getParamFromGroup
<
int
>
(
paramGroup
,
"LinearSolver.PreconditionerIterations"
);
}
else
precondIter_
=
getParamFromGroup
<
int
>
(
paramGroup
,
"LinearSolver.Preconditioner.Iterations"
,
1
);
if
(
hasParamInGroup
(
paramGroup
,
"LinearSolver.PreconditionerVerbosity"
))
{
std
::
cerr
<<
"Deprecation warning: parameter LinearSolver.PreconditionerVerbosity is deprecated and will be removed after 3.2. "
<<
"Use LinearSolver.Preconditioner.Verbosity instead (Preconditioner subgroup)."
<<
std
::
endl
;
precondVerbosity_
=
getParamFromGroup
<
int
>
(
paramGroup
,
"LinearSolver.PreconditionerVerbosity"
);
}
else
precondVerbosity_
=
getParamFromGroup
<
int
>
(
paramGroup
,
"LinearSolver.Preconditioner.Verbosity"
,
0
);
// TODO: use this code instead of the above code after release 3.2
// relaxation_ = getParamFromGroup<double>(paramGroup, "LinearSolver.Preconditioner.Relaxation", 1);
// precondIter_ = getParamFromGroup<int>(paramGroup, "LinearSolver.Preconditioner.Iterations", 1);
// precondVerbosity_ = getParamFromGroup<int>(paramGroup, "LinearSolver.Preconditioner.Verbosity", 0);
}
/*!
...
...
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