Add Petsc to OPM.

This commit is contained in:
Liu Ming committed 2014-05-16 14:41:51 +08:00
1 parent d50b7ab4aa
commit 34dfb85919
5 files changed
+514

No files matched your search

+6
View File
@@ -31,6 +31,7 @@
#include <opm/core/linalg/LinearSolverIstl.hpp>
#endif
#include <opm/core/linalg/LinearSolverPetsc.hpp>
#include <opm/core/utility/parameters/ParameterGroup.hpp>
#include <opm/core/utility/ErrorMacros.hpp>
#include <string>
@@ -46,6 +47,8 @@ namespace Opm
#elif HAVE_DUNE_ISTL
solver_.reset(new LinearSolverIstl);
#else
solver_.reset(new LinearSolverPetsc);
OPM_THROW(std::runtime_error, "No linear solver available, you must have UMFPACK or dune-istl installed to use LinearSolverFactory.");
#endif
}
@@ -69,6 +72,9 @@ namespace Opm
solver_.reset(new LinearSolverIstl(param));
#endif
}
else if (ls == "petsc"){
solver_.reset(new LinearSolverPetsc(param));
}
else {
OPM_THROW(std::runtime_error, "Linear solver " << ls << " is unknown.");