SimulatorBase: only care about the solver in the run() method

this is necessary because some older simulations only provide the
full-fledged solver class but no physical model.

(also, this allows to use something else than the standard newton
solver.)
This commit is contained in:
Andreas Lauser committed 2015-05-28 13:55:54 +02:00
1 parent a154c8394d
commit 662cd9791e
5 files changed
+51 -46

No files matched your search

+25 -13
View File
@@ -88,7 +88,7 @@ namespace Opm
typedef typename Traits::WellState WellState;
typedef typename Traits::OutputWriter OutputWriter;
typedef typename Traits::Grid Grid;
typedef typename Traits::Model Model;
typedef typename Traits::Solver Solver;
/// Initialise from parameters and objects to observe.
/// \param[in] param parameters, this class accepts the following:
@@ -150,20 +150,32 @@ namespace Opm
const Wells* wells)
{};
std::shared_ptr<Model> createModel(const typename Model::ModelParameters &modelParams,
const Wells* wells)
std::shared_ptr<Solver> createSolver(const Wells* wells)
{
return std::make_shared<Model>(modelParams,
grid_,
props_,
geo_,
rock_comp_props_,
wells,
solver_,
has_disgas_,
has_vapoil_,
terminal_output_);
typedef typename Traits::Model Model;
typedef typename Model::ModelParameters ModelParams;
ModelParams modelParams( param_ );
typedef NewtonSolver<Model> Solver;
auto model = std::make_shared<Model>(modelParams,
grid_,
props_,
geo_,
rock_comp_props_,
wells,
solver_,
has_disgas_,
has_vapoil_,
terminal_output_);
if (!threshold_pressures_by_face_.empty()) {
model->setThresholdPressures(threshold_pressures_by_face_);
}
typedef typename Solver::SolverParameters SolverParams;
SolverParams solverParams( param_ );
return std::make_shared<Solver>(solverParams, model);
}
void