Make sure WellTestState is initialized also on non IO rank

This commit is contained in:
Joakim Hove 2021-10-15 13:31:08 +02:00
parent 9a9ccb90b8
commit daabe1ca76

View File

@ -180,6 +180,7 @@ namespace {
std::shared_ptr<Opm::Schedule>& schedule, std::shared_ptr<Opm::Schedule>& schedule,
std::unique_ptr<Opm::UDQState>& udqState, std::unique_ptr<Opm::UDQState>& udqState,
std::unique_ptr<Opm::Action::State>& actionState, std::unique_ptr<Opm::Action::State>& actionState,
std::unique_ptr<Opm::WellTestState>& wtestState,
Opm::ErrorGuard& errorGuard) Opm::ErrorGuard& errorGuard)
{ {
if (schedule == nullptr) { if (schedule == nullptr) {
@ -192,6 +193,7 @@ namespace {
((*schedule)[0].udq().params().undefinedValue()); ((*schedule)[0].udq().params().undefinedValue());
actionState = std::make_unique<Opm::Action::State>(); actionState = std::make_unique<Opm::Action::State>();
wtestState = std::make_unique<Opm::WellTestState>();
} }
std::shared_ptr<Opm::Deck> std::shared_ptr<Opm::Deck>
@ -276,7 +278,7 @@ namespace {
else { else {
createNonRestartDynamicObjects(*deck, *eclipseState, createNonRestartDynamicObjects(*deck, *eclipseState,
*parseContext, std::move(python), *parseContext, std::move(python),
schedule, udqState, actionState, schedule, udqState, actionState, wtestState,
errorGuard); errorGuard);
} }
@ -302,6 +304,7 @@ namespace {
std::shared_ptr<Opm::Schedule>& schedule, std::shared_ptr<Opm::Schedule>& schedule,
std::unique_ptr<Opm::UDQState>& udqState, std::unique_ptr<Opm::UDQState>& udqState,
std::unique_ptr<Opm::Action::State>& actionState, std::unique_ptr<Opm::Action::State>& actionState,
std::unique_ptr<Opm::WellTestState>& wtestState,
std::shared_ptr<Opm::SummaryConfig>& summaryConfig) std::shared_ptr<Opm::SummaryConfig>& summaryConfig)
{ {
if (eclipseState == nullptr) { if (eclipseState == nullptr) {
@ -320,6 +323,10 @@ namespace {
actionState = std::make_unique<Opm::Action::State>(); actionState = std::make_unique<Opm::Action::State>();
} }
if (wtestState == nullptr) {
wtestState = std::make_unique<Opm::WellTestState>();
}
if (summaryConfig == nullptr) { if (summaryConfig == nullptr) {
summaryConfig = std::make_shared<Opm::SummaryConfig>(); summaryConfig = std::make_shared<Opm::SummaryConfig>();
} }
@ -464,7 +471,7 @@ void Opm::readDeck(Opm::Parallel::Communication comm,
#if HAVE_MPI #if HAVE_MPI
else { else {
defineStateObjectsOnNonIORank(comm, std::move(python), eclipseState, defineStateObjectsOnNonIORank(comm, std::move(python), eclipseState,
schedule, udqState, actionState, schedule, udqState, actionState, wtestState,
summaryConfig); summaryConfig);
} }