diff --git a/ebos/eclgenericvanguard.cc b/ebos/eclgenericvanguard.cc index 60831a7a4..c86fa62c7 100644 --- a/ebos/eclgenericvanguard.cc +++ b/ebos/eclgenericvanguard.cc @@ -61,6 +61,7 @@ std::unique_ptr EclGenericVanguard::externalEclState_; std::unique_ptr EclGenericVanguard::externalEclSchedule_; std::unique_ptr EclGenericVanguard::externalEclSummaryConfig_; std::unique_ptr EclGenericVanguard::externalUDQState_; +std::unique_ptr EclGenericVanguard::externalActionState_; std::unique_ptr EclGenericVanguard::comm_; EclGenericVanguard::EclGenericVanguard() @@ -106,6 +107,11 @@ void EclGenericVanguard::setExternalUDQState(std::unique_ptr udqState) externalUDQState_ = std::move(udqState); } +void EclGenericVanguard::setExternalActionState(std::unique_ptr actionState) +{ + externalActionState_ = std::move(actionState); +} + std::string EclGenericVanguard::canonicalDeckPath(const std::string& caseName) { const auto fileExists = [](const filesystem::path& f) -> bool @@ -266,7 +272,7 @@ void EclGenericVanguard::init() parseContext_ = createParseContext(ignoredKeywords_, eclStrictParsing_); } - readDeck(myRank, fileName_, deck_, eclState_, eclSchedule_, udqState_, + readDeck(myRank, fileName_, deck_, eclState_, eclSchedule_, udqState_, actionState_, eclSummaryConfig_, std::move(errorGuard), python, std::move(parseContext_), /* initFromRestart = */ false, /* checkDeck = */ enableExperiments_, outputInterval_); @@ -275,8 +281,13 @@ void EclGenericVanguard::init() this->udqState_ = std::move(EclGenericVanguard::externalUDQState_); else this->udqState_ = std::make_unique( this->eclSchedule_->getUDQConfig(0).params().undefinedValue() ); + + if (EclGenericVanguard::externalActionState_) + this->actionState_ = std::move(EclGenericVanguard::externalActionState_); + else + this->actionState_ = std::make_unique(); + this->summaryState_ = std::make_unique( TimeService::from_time_t(this->eclSchedule_->getStartTime() )); - this->actionState_ = std::make_unique(); // Initialize parallelWells with all local wells const auto& schedule_wells = schedule().getWellsatEnd(); diff --git a/ebos/eclgenericvanguard.hh b/ebos/eclgenericvanguard.hh index 544aafe95..9fc79a368 100644 --- a/ebos/eclgenericvanguard.hh +++ b/ebos/eclgenericvanguard.hh @@ -153,6 +153,7 @@ public: static void setExternalSummaryConfig(std::unique_ptr summaryConfig); static void setExternalUDQState(std::unique_ptr udqState); + static void setExternalActionState(std::unique_ptr actionState); /*! * \brief Return a reference to the parsed ECL deck. */ @@ -301,6 +302,7 @@ protected: static std::unique_ptr externalEclSchedule_; static std::unique_ptr externalEclSummaryConfig_; static std::unique_ptr externalUDQState_; + static std::unique_ptr externalActionState_; static std::unique_ptr comm_; std::string caseName_; diff --git a/opm/simulators/flow/Main.hpp b/opm/simulators/flow/Main.hpp index e9b641eec..01ab24fd0 100644 --- a/opm/simulators/flow/Main.hpp +++ b/opm/simulators/flow/Main.hpp @@ -47,6 +47,7 @@ #include #include #include +#include #include #include @@ -470,7 +471,7 @@ namespace Opm if (output_param >= 0) outputInterval = output_param; - readDeck(mpiRank, deckFilename, deck_, eclipseState_, schedule_, udqState_, + readDeck(mpiRank, deckFilename, deck_, eclipseState_, schedule_, udqState_, actionState_, summaryConfig_, nullptr, python, std::move(parseContext), init_from_restart_file, outputCout_, outputInterval); @@ -552,6 +553,7 @@ namespace Opm std::unique_ptr eclipseState_; std::unique_ptr schedule_; std::unique_ptr udqState_; + std::unique_ptr actionState_; std::unique_ptr summaryConfig_; }; diff --git a/opm/simulators/utils/readDeck.cpp b/opm/simulators/utils/readDeck.cpp index d1fb28652..476936f25 100644 --- a/opm/simulators/utils/readDeck.cpp +++ b/opm/simulators/utils/readDeck.cpp @@ -48,6 +48,7 @@ #include #include #include +#include #include #include @@ -191,7 +192,7 @@ void setupMessageLimiter(const Opm::MessageLimits msgLimits, const std::string& void readDeck(int rank, std::string& deckFilename, std::unique_ptr& deck, std::unique_ptr& eclipseState, - std::unique_ptr& schedule, std::unique_ptr& udqState, std::unique_ptr& summaryConfig, + std::unique_ptr& schedule, std::unique_ptr& udqState, std::unique_ptr& actionState, std::unique_ptr& summaryConfig, std::unique_ptr errorGuard, std::shared_ptr& python, std::unique_ptr parseContext, bool initFromRestart, bool checkDeck, const std::optional& outputInterval) { @@ -280,6 +281,7 @@ void readDeck(int rank, std::string& deckFilename, std::unique_ptr& d udqState = std::make_unique((*schedule)[0].udq().params().undefinedValue()); udqState->load_rst(rst_state); + actionState = std::make_unique(); } else { if (!schedule) { @@ -289,6 +291,7 @@ void readDeck(int rank, std::string& deckFilename, std::unique_ptr& d } udqState = std::make_unique((*schedule)[0].udq().params().undefinedValue()); + actionState = std::make_unique(); } diff --git a/opm/simulators/utils/readDeck.hpp b/opm/simulators/utils/readDeck.hpp index 01d0aea00..be200431a 100644 --- a/opm/simulators/utils/readDeck.hpp +++ b/opm/simulators/utils/readDeck.hpp @@ -38,6 +38,10 @@ class Schedule; class SummaryConfig; class UDQState; +namespace Action { +class State; +} + enum class FileOutputMode { //! \brief No output to files. OUTPUT_NONE = 0, @@ -54,7 +58,7 @@ FileOutputMode setupLogging(int mpi_rank_, const std::string& deck_filename, con /// /// If pointers already contains objects then they are used otherwise they are created and can be used outside later. void readDeck(int rank, std::string& deckFilename, std::unique_ptr& deck, std::unique_ptr& eclipseState, - std::unique_ptr& schedule, std::unique_ptr& udqState, std::unique_ptr& summaryConfig, + std::unique_ptr& schedule, std::unique_ptr& udqState, std::unique_ptr& actionState, std::unique_ptr& summaryConfig, std::unique_ptr errorGuard, std::shared_ptr& python, std::unique_ptr parseContext, bool initFromRestart, bool checkDeck, const std::optional& outputInterval); } // end namespace Opm diff --git a/tests/run-regressionTest.sh b/tests/run-regressionTest.sh index 5eb7c17cf..40b147b95 100755 --- a/tests/run-regressionTest.sh +++ b/tests/run-regressionTest.sh @@ -37,4 +37,5 @@ then ${COMPARE_ECL_COMMAND} ${ignore_extra_kw} -a ${INPUT_DATA_PATH}/opm-simulation-reference/${EXE_NAME}/${FILENAME} ${RESULT_PATH}/${FILENAME} ${ABS_TOL} ${REL_TOL} fi +echo ">>> ${COMPARE_ECL_COMMAND} ${ignore_extra_kw} ${INPUT_DATA_PATH}/opm-simulation-reference/${EXE_NAME}/${FILENAME} ${RESULT_PATH}/${FILENAME} ${ABS_TOL} ${REL_TOL}" exit $ecode