Add <config.h> include, clean up comments.

This commit is contained in:
Atgeirr Flø Rasmussen 2019-06-05 15:57:45 +02:00
parent c21fd6f26d
commit 38a61fa0c0

View File

@ -17,6 +17,8 @@
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>
#include <opm/simulators/linalg/setupPropertyTree.hpp>
#include <boost/property_tree/json_parser.hpp>
@ -24,6 +26,11 @@
namespace Opm
{
/// Set up a property tree intended for FlexibleSolver by either reading
/// the tree from a JSON file or creating a tree giving the default solver
/// and preconditioner. If the latter, the parameters --linear-solver-reduction,
/// --linear-solver-maxiter and --linear-solver-verbosity are used, but if reading
/// from file the data in the JSON file will override any other options.
boost::property_tree::ptree
setupPropertyTree(const FlowLinearSolverParameters& p)
{
@ -34,83 +41,11 @@ setupPropertyTree(const FlowLinearSolverParameters& p)
prm.put("tol", p.linear_solver_reduction_);
prm.put("maxiter", p.linear_solver_maxiter_);
prm.put("verbosity", p.linear_solver_verbosity_);
prm.put("preconditioner", "ILU0");
prm.put("solver", "bicgstab");
prm.put("w", 1.0);
prm.put("n", 1);
prm.put("preconditioner.type", "ParOverILU0");
prm.put("preconditioner.relaxation", 1.0);
}
/*
prm.put("tol", 0.5);
prm.put("maxiter", 20);
prm.put("preconditioner", "cpr");
prm.put("w", 1);
prm.put("n", 1);
prm.put("cpr.finesmoother.preconditioner", "ILU0");
prm.put("cpr.finesmoother.w", 1);
prm.put("cpr.finesmoother.n", 1);
prm.put("cpr.coarsesolver.tol", 0.5);
prm.put("cpr.coarsesolver.maxiter", 20);
prm.put("cpr.coarsesolver.preconditioner", "amg");
prm.put("cpr.coarsesolver.amg.maxlevel", 5);
prm.put("cpr.coarsesolver.amg.coarsenTarget", 1000);
prm.put("cpr.coarsesolver.amg.smoother", "ILU0");
prm.put("cpr.coarsesolver.amg.alpha", 0.2);
prm.put("cpr.coarsesolver.amg.beta", 0.0001);
prm.put("cpr.coarsesolver.amg.verbosity", 0);
prm.put("cpr.coarsesolver.amg.n", 1);
prm.put("cpr.coarsesolver.amg.w", 1);
prm.put("cpr.coarsesolver.verbosity", 0);
prm.put("cpr.coarsesolver.solver", "bicgstab");
prm.put("cpr.verbosity", 11);
prm.put("cpr.weights_filename" , "weight_cpr.txt");
prm.put("cpr.pressure_var_index" , 1);
prm.put("verbosity", 10);
prm.put("solver", "bicgstab");
prm.put("restart", 20);
*/
return prm;
}
} // namespace Opm
/*
{
"tol": "0.5",
"maxiter": "20",
"preconditioner": "cpr",
"w": "1",
"n": "1",
"amg": "",
"cpr": {
"finesmoother": {
"preconditioner": "ILU0",
"w": "1",
"n": "1"
},
"coarsesolver": {
"tol": "0.5",
"maxiter": "20",
"preconditioner": "amg",
"amg": {
"maxlevel": "5",
"coarsenTarget": "1000",
"smoother": "ILU0",
"alpha": "0.2",
"beta": "0.0001",
"verbosity": "0",
"n": "1",
"w": "1"
},
"verbosity": "0",
"solver": "bicgstab"
},
"verbosity": "11",
"weights_filename" : "weight_cpr.txt",
"pressure_var_index" : "1"
},
"verbosity": "10",
"solver": "bicgstab",
"restart": "20"
}
*/