Commit 5bb66250 authored by Timo Koch's avatar Timo Koch
Browse files

[params][solver] Deprecate oldstyle preconditioner parameters

parent bb0a9d29
...@@ -46,9 +46,9 @@ public: ...@@ -46,9 +46,9 @@ public:
* - LinearSolver.Verbosity the verbosity level of the linear solver * - LinearSolver.Verbosity the verbosity level of the linear solver
* - LinearSolver.MaxIterations the maximum iterations of the solver * - LinearSolver.MaxIterations the maximum iterations of the solver
* - LinearSolver.ResidualReduction the residual reduction threshold, i.e. stopping criterion * - LinearSolver.ResidualReduction the residual reduction threshold, i.e. stopping criterion
* - LinearSolver.PreconditionerRelaxation precondition relaxation * - LinearSolver.Preconditioner.Relaxation precondition relaxation
* - LinearSolver.PreconditionerIterations the number of preconditioner iterations * - LinearSolver.Preconditioner.Iterations the number of preconditioner iterations
* - LinearSolver.PreconditionerVerbosity the preconditioner verbosity level * - LinearSolver.Preconditioner.Verbosity the preconditioner verbosity level
*/ */
LinearSolver(const std::string& paramGroup = "") LinearSolver(const std::string& paramGroup = "")
: paramGroup_(paramGroup) : paramGroup_(paramGroup)
...@@ -56,9 +56,41 @@ public: ...@@ -56,9 +56,41 @@ public:
verbosity_ = getParamFromGroup<int>(paramGroup, "LinearSolver.Verbosity", 0); verbosity_ = getParamFromGroup<int>(paramGroup, "LinearSolver.Verbosity", 0);
maxIter_ = getParamFromGroup<int>(paramGroup, "LinearSolver.MaxIterations", 250); maxIter_ = getParamFromGroup<int>(paramGroup, "LinearSolver.MaxIterations", 250);
residReduction_ = getParamFromGroup<double>(paramGroup, "LinearSolver.ResidualReduction", 1e-13); residReduction_ = getParamFromGroup<double>(paramGroup, "LinearSolver.ResidualReduction", 1e-13);
relaxation_ = getParamFromGroup<double>(paramGroup, "LinearSolver.PreconditionerRelaxation", 1);
precondIter_ = getParamFromGroup<int>(paramGroup, "LinearSolver.PreconditionerIterations", 1); // for deprecation period we ask also for the "old" parameters but print a warning
precondVerbosity_ = getParamFromGroup<int>(paramGroup, "LinearSolver.PreconditionerVerbosity", 0); // 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);
} }
/*! /*!
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment