Set default solver depending on configuration.

This commit is contained in:
Atgeirr Flø Rasmussen 2016-06-15 14:18:11 +02:00
parent 1b6048016b
commit e6da69575a

View File

@ -61,8 +61,18 @@ namespace Opm
LinearSolverFactory::LinearSolverFactory(const parameter::ParameterGroup& param) LinearSolverFactory::LinearSolverFactory(const parameter::ParameterGroup& param)
{ {
#if HAVE_SUITESPARSE_UMFPACK_H
std::string default_solver = "umfpack";
#elif HAVE_DUNE_ISTL
std::string default_solver = "istl";
#elif HAVE_PETSC
std::string default_solver = "petsc";
#else
OPM_THROW(std::runtime_error, "No linear solver available, you must have UMFPACK , dune-istl or Petsc installed to use LinearSolverFactory.");
#endif
const std::string ls = const std::string ls =
param.getDefault<std::string>("linsolver", "umfpack"); param.getDefault<std::string>("linsolver", default_solver);
if (ls == "umfpack") { if (ls == "umfpack") {
#if HAVE_SUITESPARSE_UMFPACK_H #if HAVE_SUITESPARSE_UMFPACK_H