From dd1359bcf07a13928b4d197c3efa2f11bfae0fb2 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Tue, 15 Aug 2023 12:10:01 +0200 Subject: [PATCH 1/3] changed: move EclActionHandler to opm/simulators/flow no opm-models usage --- CMakeLists_files.cmake | 4 ++-- ebos/eclproblem.hh | 2 +- .../simulators/flow/EclActionHandler.cpp | 3 +-- .../simulators/flow/EclActionHandler.hpp | 14 +++++++------- 4 files changed, 11 insertions(+), 12 deletions(-) rename ebos/eclactionhandler.cc => opm/simulators/flow/EclActionHandler.cpp (99%) rename ebos/eclactionhandler.hh => opm/simulators/flow/EclActionHandler.hpp (88%) diff --git a/CMakeLists_files.cmake b/CMakeLists_files.cmake index be6ed3424..1e748cfb1 100644 --- a/CMakeLists_files.cmake +++ b/CMakeLists_files.cmake @@ -24,7 +24,6 @@ # find opm -name '*.c*' -printf '\t%p\n' | sort list (APPEND MAIN_SOURCE_FILES ebos/collecttoiorank.cc - ebos/eclactionhandler.cc ebos/eclgenericcpgridvanguard.cc ebos/eclgenericoutputblackoilmodule.cc ebos/eclgenericproblem.cc @@ -45,6 +44,7 @@ list (APPEND MAIN_SOURCE_FILES opm/simulators/flow/Banners.cpp opm/simulators/flow/countGlobalCells.cpp opm/simulators/flow/ConvergenceOutputConfiguration.cpp + opm/simulators/flow/EclActionHandler.cpp opm/simulators/flow/ExtraConvergenceOutputThread.cpp opm/simulators/flow/FlowMainEbos.cpp opm/simulators/flow/KeywordValidation.cpp @@ -380,7 +380,6 @@ list (APPEND PUBLIC_HEADER_FILES ebos/collecttoiorank.hh ebos/collecttoiorank_impl.hh ebos/ebos.hh - ebos/eclactionhandler.hh ebos/eclalugridvanguard.hh ebos/eclbaseaquifermodel.hh ebos/eclbasevanguard.hh @@ -422,6 +421,7 @@ list (APPEND PUBLIC_HEADER_FILES opm/simulators/flow/BlackoilModelParametersEbos.hpp opm/simulators/flow/Banners.hpp opm/simulators/flow/ConvergenceOutputConfiguration.hpp + opm/simulators/flow/EclActionHandler.hpp opm/simulators/flow/ExtraConvergenceOutputThread.hpp opm/simulators/flow/FlowMainEbos.hpp opm/simulators/flow/Main.hpp diff --git a/ebos/eclproblem.hh b/ebos/eclproblem.hh index 35d347eb5..28ec35973 100644 --- a/ebos/eclproblem.hh +++ b/ebos/eclproblem.hh @@ -32,7 +32,6 @@ #include #include -#include #include #include #include @@ -78,6 +77,7 @@ #include +#include #include #include #include diff --git a/ebos/eclactionhandler.cc b/opm/simulators/flow/EclActionHandler.cpp similarity index 99% rename from ebos/eclactionhandler.cc rename to opm/simulators/flow/EclActionHandler.cpp index 5fe1b9448..16eef7e51 100644 --- a/ebos/eclactionhandler.cc +++ b/opm/simulators/flow/EclActionHandler.cpp @@ -22,8 +22,7 @@ */ #include - -#include +#include #include #include diff --git a/ebos/eclactionhandler.hh b/opm/simulators/flow/EclActionHandler.hpp similarity index 88% rename from ebos/eclactionhandler.hh rename to opm/simulators/flow/EclActionHandler.hpp index a758f9750..044bbd58c 100644 --- a/ebos/eclactionhandler.hh +++ b/opm/simulators/flow/EclActionHandler.hpp @@ -21,8 +21,8 @@ copyright holders. */ -#ifndef ECL_ACTION_HANDLER_HH -#define ECL_ACTION_HANDLER_HH +#ifndef ECL_ACTION_HANDLER_HPP +#define ECL_ACTION_HANDLER_HPP #include @@ -69,10 +69,10 @@ public: private: /* - This function is run after applyAction has been completed in the Schedule - implementation. The sim_update argument should have members & flags for - the simulator properties which need to be updated. This functionality is - probably not complete. + This function is run after applyAction has been completed in the Schedule + implementation. The sim_update argument should have members & flags for + the simulator properties which need to be updated. This functionality is + probably not complete. */ void applySimulatorUpdate(int report_step, const SimulatorUpdate& sim_update, @@ -94,4 +94,4 @@ private: } // namespace Opm -#endif +#endif // ECL_ACTION_HANDLER_HPP From 7da3c9624785bd3e68a09c9c2a775243cdb1ce67 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Tue, 15 Aug 2023 12:10:51 +0200 Subject: [PATCH 2/3] EclActionHandler: fix indent --- opm/simulators/flow/EclActionHandler.hpp | 70 ++++++++++++------------ 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/opm/simulators/flow/EclActionHandler.hpp b/opm/simulators/flow/EclActionHandler.hpp index 044bbd58c..01515a503 100644 --- a/opm/simulators/flow/EclActionHandler.hpp +++ b/opm/simulators/flow/EclActionHandler.hpp @@ -49,47 +49,47 @@ class UDQState; class EclActionHandler { public: - //! \brief Function handle to update transmissiblities. - using TransFunc = std::function; + //! \brief Function handle to update transmissiblities. + using TransFunc = std::function; - EclActionHandler(EclipseState& ecl_state, - Schedule& schedule, - Action::State& actionState, - SummaryState& summaryState, - BlackoilWellModelGeneric& wellModel, - Parallel::Communication comm); + EclActionHandler(EclipseState& ecl_state, + Schedule& schedule, + Action::State& actionState, + SummaryState& summaryState, + BlackoilWellModelGeneric& wellModel, + Parallel::Communication comm); - void applyActions(int reportStep, - double sim_time, - const TransFunc& updateTrans); + void applyActions(int reportStep, + double sim_time, + const TransFunc& updateTrans); - //! \brief Evaluates UDQ assign statements. - void evalUDQAssignments(const unsigned episodeIdx, - UDQState& udq_state); + //! \brief Evaluates UDQ assign statements. + void evalUDQAssignments(const unsigned episodeIdx, + UDQState& udq_state); -private: - /* - This function is run after applyAction has been completed in the Schedule - implementation. The sim_update argument should have members & flags for - the simulator properties which need to be updated. This functionality is - probably not complete. - */ - void applySimulatorUpdate(int report_step, - const SimulatorUpdate& sim_update, - bool& commit_wellstate, - const TransFunc& updateTrans); + private: + /* + This function is run after applyAction has been completed in the Schedule + implementation. The sim_update argument should have members & flags for + the simulator properties which need to be updated. This functionality is + probably not complete. + */ + void applySimulatorUpdate(int report_step, + const SimulatorUpdate& sim_update, + bool& commit_wellstate, + const TransFunc& updateTrans); - std::unordered_map - fetchWellPI(int reportStep, - const Action::ActionX& action, - const std::vector& matching_wells); + std::unordered_map + fetchWellPI(int reportStep, + const Action::ActionX& action, + const std::vector& matching_wells); - EclipseState& ecl_state_; - Schedule& schedule_; - Action::State& actionState_; - SummaryState& summaryState_; - BlackoilWellModelGeneric& wellModel_; - Parallel::Communication comm_; + EclipseState& ecl_state_; + Schedule& schedule_; + Action::State& actionState_; + SummaryState& summaryState_; + BlackoilWellModelGeneric& wellModel_; + Parallel::Communication comm_; }; } // namespace Opm From 368eac107866d42ecab013d4ffdaa11b1632bf9e Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Tue, 15 Aug 2023 12:11:33 +0200 Subject: [PATCH 3/3] EclActionHandler: mark method const --- opm/simulators/flow/EclActionHandler.cpp | 2 +- opm/simulators/flow/EclActionHandler.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/opm/simulators/flow/EclActionHandler.cpp b/opm/simulators/flow/EclActionHandler.cpp index 16eef7e51..39fefd343 100644 --- a/opm/simulators/flow/EclActionHandler.cpp +++ b/opm/simulators/flow/EclActionHandler.cpp @@ -207,7 +207,7 @@ void EclActionHandler::applySimulatorUpdate(const int report_step, std::unordered_map EclActionHandler::fetchWellPI(const int reportStep, const Action::ActionX& action, - const std::vector& matching_wells) + const std::vector& matching_wells) const { auto wellpi_wells = action.wellpi_wells(WellMatcher(schedule_[reportStep].well_order(), diff --git a/opm/simulators/flow/EclActionHandler.hpp b/opm/simulators/flow/EclActionHandler.hpp index 01515a503..a6d72f551 100644 --- a/opm/simulators/flow/EclActionHandler.hpp +++ b/opm/simulators/flow/EclActionHandler.hpp @@ -82,7 +82,7 @@ public: std::unordered_map fetchWellPI(int reportStep, const Action::ActionX& action, - const std::vector& matching_wells); + const std::vector& matching_wells) const; EclipseState& ecl_state_; Schedule& schedule_;