mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
do not use std::shared_ptr where it is deemed inappropriate by the maintainers
note that I don't agree with this change and will assume no responsibility if something goes down the gutter.
This commit is contained in:
parent
5666df807b
commit
496c32d2a6
@ -151,7 +151,7 @@ namespace Opm
|
|||||||
WellState& well_state,
|
WellState& well_state,
|
||||||
const Wells* wells);
|
const Wells* wells);
|
||||||
|
|
||||||
std::shared_ptr<Solver> createSolver(const Wells* wells);
|
Solver* createSolver(const Wells* wells);
|
||||||
|
|
||||||
void
|
void
|
||||||
computeRESV(const std::size_t step,
|
computeRESV(const std::size_t step,
|
||||||
|
@ -19,6 +19,8 @@
|
|||||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
namespace Opm
|
namespace Opm
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -328,23 +330,23 @@ namespace Opm
|
|||||||
|
|
||||||
template <class Implementation>
|
template <class Implementation>
|
||||||
auto SimulatorBase<Implementation>::createSolver(const Wells* wells)
|
auto SimulatorBase<Implementation>::createSolver(const Wells* wells)
|
||||||
-> std::shared_ptr<Solver>
|
-> Solver*
|
||||||
{
|
{
|
||||||
typedef typename Traits::Model Model;
|
typedef typename Traits::Model Model;
|
||||||
typedef typename Model::ModelParameters ModelParams;
|
typedef typename Model::ModelParameters ModelParams;
|
||||||
ModelParams modelParams( param_ );
|
ModelParams modelParams( param_ );
|
||||||
typedef NewtonSolver<Model> Solver;
|
typedef NewtonSolver<Model> Solver;
|
||||||
|
|
||||||
auto model = std::make_shared<Model>(modelParams,
|
auto model = std::unique_ptr<Model>(new Model(modelParams,
|
||||||
grid_,
|
grid_,
|
||||||
props_,
|
props_,
|
||||||
geo_,
|
geo_,
|
||||||
rock_comp_props_,
|
rock_comp_props_,
|
||||||
wells,
|
wells,
|
||||||
solver_,
|
solver_,
|
||||||
has_disgas_,
|
has_disgas_,
|
||||||
has_vapoil_,
|
has_vapoil_,
|
||||||
terminal_output_);
|
terminal_output_));
|
||||||
|
|
||||||
if (!threshold_pressures_by_face_.empty()) {
|
if (!threshold_pressures_by_face_.empty()) {
|
||||||
model->setThresholdPressures(threshold_pressures_by_face_);
|
model->setThresholdPressures(threshold_pressures_by_face_);
|
||||||
@ -352,7 +354,7 @@ namespace Opm
|
|||||||
|
|
||||||
typedef typename Solver::SolverParameters SolverParams;
|
typedef typename Solver::SolverParameters SolverParams;
|
||||||
SolverParams solverParams( param_ );
|
SolverParams solverParams( param_ );
|
||||||
return std::make_shared<Solver>(solverParams, model);
|
return new Solver(solverParams, std::move(model));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class Implementation>
|
template <class Implementation>
|
||||||
|
Loading…
Reference in New Issue
Block a user