Merge pull request #4242 from blattms/reactivate-use-gmres-flexible-solver

[bugfix] recover support for selecting GMRes as solver.
This commit is contained in:
Bård Skaflestad 2022-11-04 21:18:30 +01:00 committed by GitHub
commit d095c8c287
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -110,6 +110,18 @@ setupPropertyTree(FlowLinearSolverParameters p, // Note: copying the parameters
<< " Please use ilu0, cpr, cpr_trueimpes, cpr_quasiimpes or isai");
}
std::string getSolverString(const FlowLinearSolverParameters& p)
{
if (p.newton_use_gmres_)
{
return {"gmres"};
}
else
{
return {"bicgstab"};
}
}
PropertyTree
setupCPRW(const std::string& /*conf*/, const FlowLinearSolverParameters& p)
{
@ -118,7 +130,7 @@ setupCPRW(const std::string& /*conf*/, const FlowLinearSolverParameters& p)
prm.put("maxiter", p.linear_solver_maxiter_);
prm.put("tol", p.linear_solver_reduction_);
prm.put("verbosity", p.linear_solver_verbosity_);
prm.put("solver", "bicgstab"s);
prm.put("solver", getSolverString(p));
prm.put("preconditioner.type", "cprw"s);
prm.put("preconditioner.use_well_weights", "false"s);
prm.put("preconditioner.add_wells", "true"s);
@ -162,7 +174,7 @@ setupCPR(const std::string& conf, const FlowLinearSolverParameters& p)
prm.put("maxiter", p.linear_solver_maxiter_);
prm.put("tol", p.linear_solver_reduction_);
prm.put("verbosity", p.linear_solver_verbosity_);
prm.put("solver", "bicgstab"s);
prm.put("solver", getSolverString(p));
prm.put("preconditioner.type", "cpr"s);
if (conf == "cpr_quasiimpes") {
prm.put("preconditioner.weight_type", "quasiimpes"s);
@ -209,7 +221,7 @@ setupAMG([[maybe_unused]] const std::string& conf, const FlowLinearSolverParamet
prm.put("tol", p.linear_solver_reduction_);
prm.put("maxiter", p.linear_solver_maxiter_);
prm.put("verbosity", p.linear_solver_verbosity_);
prm.put("solver", "bicgstab"s);
prm.put("solver", getSolverString(p));
prm.put("preconditioner.type", "amg"s);
prm.put("preconditioner.alpha", 0.333333333333);
prm.put("preconditioner.relaxation", 1.0);
@ -243,7 +255,7 @@ setupILU([[maybe_unused]] const std::string& conf, const FlowLinearSolverParamet
prm.put("tol", p.linear_solver_reduction_);
prm.put("maxiter", p.linear_solver_maxiter_);
prm.put("verbosity", p.linear_solver_verbosity_);
prm.put("solver", "bicgstab"s);
prm.put("solver", getSolverString(p));
prm.put("preconditioner.type", "ParOverILU0"s);
prm.put("preconditioner.relaxation", p.ilu_relaxation_);
prm.put("preconditioner.ilulevel", p.ilu_fillin_level_);