mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-11-25 02:30:18 -06:00
Create solver and model parameters only once.
This commit is contained in:
parent
f1a20b6b3b
commit
512d18a669
@ -163,8 +163,13 @@ namespace Opm
|
|||||||
typedef RateConverter::
|
typedef RateConverter::
|
||||||
SurfaceToReservoirVoidage< BlackoilPropsAdInterface,
|
SurfaceToReservoirVoidage< BlackoilPropsAdInterface,
|
||||||
std::vector<int> > RateConverterType;
|
std::vector<int> > RateConverterType;
|
||||||
|
typedef typename Traits::Model Model;
|
||||||
|
typedef typename Model::ModelParameters ModelParameters;
|
||||||
|
typedef typename Solver::SolverParameters SolverParameters;
|
||||||
|
|
||||||
const parameter::ParameterGroup param_;
|
const parameter::ParameterGroup param_;
|
||||||
|
ModelParameters model_param_;
|
||||||
|
SolverParameters solver_param_;
|
||||||
|
|
||||||
// Observed objects.
|
// Observed objects.
|
||||||
const Grid& grid_;
|
const Grid& grid_;
|
||||||
|
@ -38,6 +38,8 @@ namespace Opm
|
|||||||
OutputWriter& output_writer,
|
OutputWriter& output_writer,
|
||||||
const std::vector<double>& threshold_pressures_by_face)
|
const std::vector<double>& threshold_pressures_by_face)
|
||||||
: param_(param),
|
: param_(param),
|
||||||
|
model_param_(param),
|
||||||
|
solver_param_(param),
|
||||||
grid_(grid),
|
grid_(grid),
|
||||||
props_(props),
|
props_(props),
|
||||||
rock_comp_props_(rock_comp_props),
|
rock_comp_props_(rock_comp_props),
|
||||||
@ -332,12 +334,7 @@ namespace Opm
|
|||||||
auto SimulatorBase<Implementation>::createSolver(const Wells* wells)
|
auto SimulatorBase<Implementation>::createSolver(const Wells* wells)
|
||||||
-> std::unique_ptr<Solver>
|
-> std::unique_ptr<Solver>
|
||||||
{
|
{
|
||||||
typedef typename Traits::Model Model;
|
auto model = std::unique_ptr<Model>(new Model(model_param_,
|
||||||
typedef typename Model::ModelParameters ModelParams;
|
|
||||||
ModelParams modelParams( param_ );
|
|
||||||
typedef NewtonSolver<Model> Solver;
|
|
||||||
|
|
||||||
auto model = std::unique_ptr<Model>(new Model(modelParams,
|
|
||||||
grid_,
|
grid_,
|
||||||
props_,
|
props_,
|
||||||
geo_,
|
geo_,
|
||||||
@ -352,9 +349,7 @@ namespace Opm
|
|||||||
model->setThresholdPressures(threshold_pressures_by_face_);
|
model->setThresholdPressures(threshold_pressures_by_face_);
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef typename Solver::SolverParameters SolverParams;
|
return std::unique_ptr<Solver>(new Solver(solver_param_, std::move(model)));
|
||||||
SolverParams solverParams( param_ );
|
|
||||||
return std::unique_ptr<Solver>(new Solver(solverParams, std::move(model)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class Implementation>
|
template <class Implementation>
|
||||||
|
Loading…
Reference in New Issue
Block a user