Set default solver depending on configuration.
This commit is contained in:
parent
1b6048016b
commit
e6da69575a
@ -61,8 +61,18 @@ namespace Opm
|
||||
|
||||
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 =
|
||||
param.getDefault<std::string>("linsolver", "umfpack");
|
||||
param.getDefault<std::string>("linsolver", default_solver);
|
||||
|
||||
if (ls == "umfpack") {
|
||||
#if HAVE_SUITESPARSE_UMFPACK_H
|
||||
|
Loading…
Reference in New Issue
Block a user