Commit 76563518 authored by Timo Koch's avatar Timo Koch
Browse files

[params] Move global defaults for linear solver to local defaults in the solver class

parent d8d8390c
......@@ -16,6 +16,8 @@ Differences Between DuMuX 3.2 and DuMuX 3.1
- __Van Genuchten__: Corrected VanGenuchten-Mualem exponent in the non-wetting saturation formula (`1/3` instead of `1/2` (or `l`, see above))
- __Van Genuchten__: Corrected VanGenuchten-Mualem implementation of `dkrn/dSw`
- __AMGBackend__: The internal structure of the AMGBackend and the ParallelISTLHelper has been overhauled, as only used by the AMG, we did not make the changes backwards-compatible
- The global default parameters for linear solvers have been removed and moved to the class `LinearSolver`.
This only affects users that directly obtain this parameter via `getParam` somewhere in the code.
- __Change matrix block arrangement for staggered models__: The matrix block structure has been adapted such that it complies with the literature standard, i.e., having the velocity block (C) on `M[0][0]`
rather than on `M[1][1]`. This also requires re-arranging the submodels and properties in dumux-multidomain such that the face-related classes and vector entries now appear before the cell-centered ones.
......
......@@ -80,7 +80,9 @@ public:
{
if (Dune::MPIHelper::getCollectiveCommunication().size() > 1)
DUNE_THROW(Dune::InvalidStateException, "Using sequential constructor for parallel run. Use signature with gridView and dofMapper!");
convertParameterTree(paramGroup);
resetDefaultParameters();
convertParameterTree_(paramGroup);
}
/*!
......@@ -96,7 +98,8 @@ public:
: phelper_(std::make_shared<ParallelISTLHelper<GridView, AMGTraits>>(gridView, dofMapper))
, firstCall_(true)
{
convertParameterTree(paramGroup);
resetDefaultParameters();
convertParameterTree_(paramGroup);
}
/*!
......@@ -146,9 +149,21 @@ public:
firstCall_ = false;
return result_.converged;
}
//! reset some defaults for the solver parameters
void resetDefaultParameters()
{
params_["restart"] = "10";
params_["maxit"] = "250";
params_["reduction"] = "1e-13";
params_["verbose"] = "0";
params_["preconditioner.iterations"] = "1";
params_["preconditioner.relaxation"] = "1.0";
}
private:
void convertParameterTree(const std::string& paramGroup="")
void convertParameterTree_(const std::string& paramGroup="")
{
const auto& loggingTree = Parameters::getTree();
auto matchingGroups = loggingTree.getSubGroups("LinearSolver", paramGroup);
......
......@@ -52,11 +52,11 @@ public:
LinearSolver(const std::string& paramGroup = "")
: paramGroup_(paramGroup)
{
verbosity_ = getParamFromGroup<int>(paramGroup, "LinearSolver.Verbosity");
maxIter_ = getParamFromGroup<int>(paramGroup, "LinearSolver.MaxIterations");
residReduction_ = getParamFromGroup<double>(paramGroup, "LinearSolver.ResidualReduction");
relaxation_ = getParamFromGroup<double>(paramGroup, "LinearSolver.PreconditionerRelaxation");
precondIter_ = getParamFromGroup<int>(paramGroup, "LinearSolver.PreconditionerIterations");
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);
}
/*!
......
Markdown is supported
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