mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Use std::shared_ptr for Python handle to Schedule
This commit is contained in:
parent
4a6814d6bc
commit
d6a1d3029e
@ -630,7 +630,7 @@ private:
|
||||
Opm::EclipseState* eclState_;
|
||||
Opm::Schedule* eclSchedule_;
|
||||
Opm::SummaryConfig* eclSummaryConfig_;
|
||||
Opm::Python python;
|
||||
std::shared_ptr<Opm::Python> python = std::make_shared<Opm::Python>();
|
||||
|
||||
Dune::EdgeWeightMethod edgeWeightsMethod_;
|
||||
bool ownersFirst_;
|
||||
|
@ -326,7 +326,7 @@ int main(int argc, char** argv)
|
||||
std::cout << "Reading deck file '" << deckFilename << "'\n";
|
||||
std::cout.flush();
|
||||
}
|
||||
Opm::Python python;
|
||||
auto python = std::make_shared<Opm::Python>();
|
||||
std::shared_ptr<Opm::Deck> deck;
|
||||
std::shared_ptr<Opm::EclipseState> eclipseState;
|
||||
std::shared_ptr<Opm::Schedule> schedule;
|
||||
|
@ -355,7 +355,7 @@ int mainFlow(int argc, char** argv)
|
||||
std::cout << "Reading deck file '" << deckFilename << "'\n";
|
||||
std::cout.flush();
|
||||
}
|
||||
Opm::Python python;
|
||||
std::shared_ptr<Opm::Python> python = std::make_shared<Opm::Python>();
|
||||
std::shared_ptr<Opm::Deck> deck;
|
||||
std::shared_ptr<Opm::EclipseState> eclipseState;
|
||||
std::shared_ptr<Opm::Schedule> schedule;
|
||||
|
@ -277,7 +277,7 @@ BOOST_AUTO_TEST_CASE( Test_Norne_PVT) {
|
||||
Opm::ParseContext parseContext({{ ParseContext::PARSE_RANDOM_SLASH , InputError::IGNORE }});
|
||||
Opm::ErrorGuard errorGuard;
|
||||
Opm::Parser parser;
|
||||
Opm::Python python;
|
||||
auto python = std::make_shared<Opm::Python>();
|
||||
|
||||
auto deck = parser.parseFile("norne_pvt.data", parseContext, errorGuard);
|
||||
|
||||
|
@ -37,7 +37,7 @@ BOOST_AUTO_TEST_CASE(TestStoppedWells)
|
||||
Opm::Parser parser;
|
||||
Opm::Deck deck(parser.parseFile(filename));
|
||||
Opm::EclipseState eclipseState(deck);
|
||||
Opm::Python python;
|
||||
auto python = std::make_shared<Opm::Python>();
|
||||
const Schedule sched(deck, eclipseState, python);
|
||||
|
||||
// Both wells are open in the first schedule step
|
||||
|
@ -71,14 +71,15 @@ struct SetupTest {
|
||||
{
|
||||
const Opm::TableManager table ( deck );
|
||||
const Opm::Runspec runspec (deck);
|
||||
python = std::make_shared<Opm::Python>();
|
||||
schedule.reset( new Opm::Schedule(deck, *ecl_state, python));
|
||||
summaryState.reset( new Opm::SummaryState(std::chrono::system_clock::from_time_t(schedule->getStartTime())));
|
||||
}
|
||||
current_timestep = 0;
|
||||
};
|
||||
|
||||
Opm::Python python;
|
||||
std::unique_ptr<const Opm::EclipseState> ecl_state;
|
||||
std::shared_ptr<Opm::Python> python;
|
||||
std::unique_ptr<const Opm::Schedule> schedule;
|
||||
std::unique_ptr<Opm::SummaryState> summaryState;
|
||||
std::vector<std::vector<Opm::PerforationData>> well_perf_data;
|
||||
|
@ -52,6 +52,7 @@ struct Setup
|
||||
: es (deck)
|
||||
, pu (Opm::phaseUsageFromDeck(es))
|
||||
, grid (es.getInputGrid())
|
||||
, python( std::make_shared<Opm::Python>() )
|
||||
, sched(deck, es, python)
|
||||
, st(std::chrono::system_clock::from_time_t(sched.getStartTime()))
|
||||
{
|
||||
@ -102,10 +103,10 @@ struct Setup
|
||||
}
|
||||
}
|
||||
|
||||
Opm::Python python;
|
||||
Opm::EclipseState es;
|
||||
Opm::PhaseUsage pu;
|
||||
Opm::GridManager grid;
|
||||
std::shared_ptr<Opm::Python> python;
|
||||
Opm::Schedule sched;
|
||||
Opm::SummaryState st;
|
||||
std::vector<std::vector<Opm::PerforationData>> well_perf_data;
|
||||
|
Loading…
Reference in New Issue
Block a user