From a4d254b74996aca89d9588707eca1d958674a3ef Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Tue, 14 Jun 2022 12:40:16 +0200 Subject: [PATCH] changed: introduce EclGenericVanguard::setParams this is used transferring ownership of setup structures to the simulator. drop all the flowEbosXXX set deck methods and use the generic vanguard. also means various structs that were only passed in the blackoil simulator are now passed in all simulators. --- ebos/eclgenericvanguard.cc | 91 +++++--------------- ebos/eclgenericvanguard.hh | 54 +++--------- flow/flow_ebos_blackoil.cpp | 21 ----- flow/flow_ebos_blackoil.hpp | 15 +--- flow/flow_ebos_brine.cpp | 15 ---- flow/flow_ebos_brine.hpp | 12 --- flow/flow_ebos_brine_precsalt_vapwat.cpp | 15 ---- flow/flow_ebos_brine_precsalt_vapwat.hpp | 12 --- flow/flow_ebos_brine_saltprecipitation.cpp | 15 ---- flow/flow_ebos_brine_saltprecipitation.hpp | 10 --- flow/flow_ebos_energy.cpp | 14 ---- flow/flow_ebos_energy.hpp | 12 --- flow/flow_ebos_extbo.cpp | 14 ---- flow/flow_ebos_extbo.hpp | 12 --- flow/flow_ebos_foam.cpp | 15 ---- flow/flow_ebos_foam.hpp | 12 --- flow/flow_ebos_gasoil.cpp | 15 ---- flow/flow_ebos_gasoil.hpp | 12 --- flow/flow_ebos_gasoil_energy.cpp | 15 ---- flow/flow_ebos_gasoil_energy.hpp | 12 --- flow/flow_ebos_gaswater.cpp | 14 ---- flow/flow_ebos_gaswater.hpp | 12 --- flow/flow_ebos_gaswater_brine.cpp | 14 ---- flow/flow_ebos_gaswater_brine.hpp | 12 --- flow/flow_ebos_gaswater_saltprec_vapwat.cpp | 14 ---- flow/flow_ebos_gaswater_saltprec_vapwat.hpp | 12 --- flow/flow_ebos_micp.cpp | 14 ---- flow/flow_ebos_micp.hpp | 12 --- flow/flow_ebos_oilwater.cpp | 14 ---- flow/flow_ebos_oilwater.hpp | 12 --- flow/flow_ebos_oilwater_brine.cpp | 14 ---- flow/flow_ebos_oilwater_brine.hpp | 12 --- flow/flow_ebos_oilwater_polymer.cpp | 14 ---- flow/flow_ebos_oilwater_polymer.hpp | 12 --- flow/flow_ebos_onephase.cpp | 15 ---- flow/flow_ebos_onephase.hpp | 20 +---- flow/flow_ebos_onephase_energy.cpp | 15 ---- flow/flow_ebos_onephase_energy.hpp | 21 +---- flow/flow_ebos_polymer.cpp | 14 ---- flow/flow_ebos_polymer.hpp | 12 --- flow/flow_ebos_solvent.cpp | 15 ---- flow/flow_ebos_solvent.hpp | 12 --- opm/simulators/flow/Main.hpp | 92 +++++---------------- 43 files changed, 58 insertions(+), 733 deletions(-) diff --git a/ebos/eclgenericvanguard.cc b/ebos/eclgenericvanguard.cc index d676c517e..a19cee981 100644 --- a/ebos/eclgenericvanguard.cc +++ b/ebos/eclgenericvanguard.cc @@ -55,9 +55,9 @@ std::shared_ptr EclGenericVanguard::deck_; std::shared_ptr EclGenericVanguard::eclState_; std::shared_ptr EclGenericVanguard::eclSchedule_; std::shared_ptr EclGenericVanguard::eclSummaryConfig_; -std::unique_ptr EclGenericVanguard::externalUDQState_; -std::unique_ptr EclGenericVanguard::externalActionState_; -std::unique_ptr EclGenericVanguard::externalWTestState_; +std::unique_ptr EclGenericVanguard::udqState_; +std::unique_ptr EclGenericVanguard::actionState_; +std::unique_ptr EclGenericVanguard::wtestState_; std::unique_ptr EclGenericVanguard::comm_; EclGenericVanguard::EclGenericVanguard() @@ -67,61 +67,23 @@ EclGenericVanguard::EclGenericVanguard() EclGenericVanguard::~EclGenericVanguard() = default; -void EclGenericVanguard::setSchedule(std::shared_ptr schedule) +void EclGenericVanguard::setParams(double setupTime, + std::shared_ptr deck, + std::shared_ptr eclState, + std::shared_ptr schedule, + std::unique_ptr udqState, + std::unique_ptr actionState, + std::unique_ptr wtestState, + std::shared_ptr summaryConfig) { - eclSchedule_ = std::move(schedule); -} - -void EclGenericVanguard::setSchedule(std::unique_ptr schedule) -{ - eclSchedule_ = std::move(schedule); -} - -void EclGenericVanguard::setSummaryConfig( - std::shared_ptr summaryConfig) -{ - eclSummaryConfig_ = std::move(summaryConfig); -} - -void EclGenericVanguard::setSummaryConfig( - std::unique_ptr summaryConfig) -{ - eclSummaryConfig_ = std::move(summaryConfig); -} - -void EclGenericVanguard::setDeck(std::shared_ptr deck) -{ - deck_ = std::move(deck); -} - -void EclGenericVanguard::setDeck(std::unique_ptr deck) -{ - deck_ = std::move(deck); -} - -void EclGenericVanguard::setEclState(std::shared_ptr eclState) -{ - eclState_ = std::move(eclState); -} - -void EclGenericVanguard::setEclState(std::unique_ptr eclState) -{ - eclState_ = std::move(eclState); -} - -void EclGenericVanguard::setExternalUDQState(std::unique_ptr udqState) -{ - externalUDQState_ = std::move(udqState); -} - -void EclGenericVanguard::setExternalActionState(std::unique_ptr actionState) -{ - externalActionState_ = std::move(actionState); -} - -void EclGenericVanguard::setExternalWTestState(std::unique_ptr wtestState) -{ - externalWTestState_ = std::move(wtestState); + EclGenericVanguard::setupTime_ = setupTime; + EclGenericVanguard::deck_ = std::move(deck); + EclGenericVanguard::eclState_ = std::move(eclState); + EclGenericVanguard::eclSchedule_ = std::move(schedule); + EclGenericVanguard::udqState_ = std::move(udqState); + EclGenericVanguard::actionState_ = std::move(actionState); + EclGenericVanguard::wtestState_ = std::move(wtestState); + EclGenericVanguard::eclSummaryConfig_ = std::move(summaryConfig); } std::string EclGenericVanguard::canonicalDeckPath(const std::string& caseName) @@ -210,21 +172,6 @@ void EclGenericVanguard::init() std::transform(caseName_.begin(), caseName_.end(), caseName_.begin(), ::toupper); } - if (EclGenericVanguard::externalUDQState_) - 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(); - - if (EclGenericVanguard::externalWTestState_) - this->wtestState_ = std::move(EclGenericVanguard::externalWTestState_); - else - this->wtestState_ = std::make_unique(); - this->summaryState_ = std::make_unique( TimeService::from_time_t(this->eclSchedule_->getStartTime() )); // Initialize parallelWells with all local wells diff --git a/ebos/eclgenericvanguard.hh b/ebos/eclgenericvanguard.hh index 347d251f6..a1ee2a81e 100644 --- a/ebos/eclgenericvanguard.hh +++ b/ebos/eclgenericvanguard.hh @@ -87,14 +87,6 @@ public: */ static std::string canonicalDeckPath(const std::string& caseName); - /*! - * \brief Set the wall time which was spend externally to set up the external data structures - * - * i.e., the objects specified via the other set*() methods. - */ - static void setSetupTime(double t) - { setupTime_ = t; } - /*! * \brief Returns the wall time required to set up the simulator before it was born. */ @@ -102,35 +94,16 @@ public: { return setupTime_; } /*! - * \brief Set the Opm::Deck object which ought to be used when the simulator vanguard - * is instantiated. + * \brief Set the simulation configuration objects. */ - static void setDeck(std::shared_ptr deck); - static void setDeck(std::unique_ptr deck); - - /*! - * \brief Set the Opm::EclipseState object which ought to be used when the simulator - * vanguard is instantiated. - */ - static void setEclState(std::shared_ptr eclState); - static void setEclState(std::unique_ptr eclState); - - /*! - * \brief Set the schedule object. - */ - static void setSchedule(std::shared_ptr schedule); - static void setSchedule(std::unique_ptr schedule); - - /*! - * \brief Set the summary configuration object. - */ - static void setSummaryConfig(std::shared_ptr summaryConfig); - static void setSummaryConfig(std::unique_ptr summaryConfig); - - static void setExternalUDQState(std::unique_ptr udqState); - static void setExternalActionState(std::unique_ptr actionState); - static void setExternalWTestState(std::unique_ptr wtestState); - + static void setParams(double setupTime, + std::shared_ptr deck, + std::shared_ptr eclState, + std::shared_ptr schedule, + std::unique_ptr udqState, + std::unique_ptr actionState, + std::unique_ptr wtestState, + std::shared_ptr summaryConfig); /*! * \brief Return a reference to the parsed ECL deck. @@ -291,9 +264,6 @@ protected: static double setupTime_; // These variables may be owned by both Python and the simulator - static std::unique_ptr externalUDQState_; - static std::unique_ptr externalActionState_; - static std::unique_ptr externalWTestState_; static std::unique_ptr comm_; std::string caseName_; @@ -315,14 +285,14 @@ protected: bool enableExperiments_; std::unique_ptr summaryState_; - std::unique_ptr udqState_; - std::unique_ptr actionState_; + static std::unique_ptr udqState_; + static std::unique_ptr actionState_; // Observe that this instance is handled differently from the other state // variables, it will only be initialized for a restart run. While // initializing a restarted run this instance is transferred to the WGState // member in the well model. - std::unique_ptr wtestState_; + static std::unique_ptr wtestState_; // these attributes point either to the internal or to the external version of the // parser objects. diff --git a/flow/flow_ebos_blackoil.cpp b/flow/flow_ebos_blackoil.cpp index 8187b96ee..452ce99d1 100644 --- a/flow/flow_ebos_blackoil.cpp +++ b/flow/flow_ebos_blackoil.cpp @@ -24,27 +24,6 @@ namespace Opm { -void flowEbosBlackoilSetDeck(double setupTime, std::shared_ptr deck, - std::shared_ptr eclState, - std::shared_ptr schedule, - std::unique_ptr udqState, - std::unique_ptr actionState, - std::unique_ptr wtestState, - std::shared_ptr summaryConfig) -{ - using TypeTag = Properties::TTag::EclFlowProblem; - using Vanguard = GetPropType; - - Vanguard::setSetupTime(setupTime); - Vanguard::setDeck(std::move(deck)); - Vanguard::setEclState(std::move(eclState)); - Vanguard::setSchedule(std::move(schedule)); - Vanguard::setExternalUDQState(std::move(udqState)); - Vanguard::setExternalActionState(std::move(actionState)); - Vanguard::setExternalWTestState(std::move(wtestState)); - Vanguard::setSummaryConfig(std::move(summaryConfig)); -} - std::unique_ptr> flowEbosBlackoilMainInit(int argc, char** argv, bool outputCout, bool outputFiles) { diff --git a/flow/flow_ebos_blackoil.hpp b/flow/flow_ebos_blackoil.hpp index b60c64354..c20f77187 100644 --- a/flow/flow_ebos_blackoil.hpp +++ b/flow/flow_ebos_blackoil.hpp @@ -21,26 +21,13 @@ namespace Opm { -class Deck; -class EclipseState; template class FlowMainEbos; -class Schedule; -class SummaryConfig; -class UDQState; -class WellTestState; + namespace Action { class State; } namespace Properties { namespace TTag { struct EclFlowProblem; } } -void flowEbosBlackoilSetDeck(double setupTime, std::shared_ptr deck, - std::shared_ptr eclState, - std::shared_ptr schedule, - std::unique_ptr udqState, - std::unique_ptr actionState, - std::unique_ptr wtestState, - std::shared_ptr summaryConfig); - //! \brief Main function used in flow binary. int flowEbosBlackoilMain(int argc, char** argv, bool outputCout, bool outputFiles); diff --git a/flow/flow_ebos_brine.cpp b/flow/flow_ebos_brine.cpp index f1fe7d6a1..f3c01dae8 100644 --- a/flow/flow_ebos_brine.cpp +++ b/flow/flow_ebos_brine.cpp @@ -37,21 +37,6 @@ struct EnableBrine { }} namespace Opm { -void flowEbosBrineSetDeck(double setupTime, std::shared_ptr deck, - std::shared_ptr eclState, - std::shared_ptr schedule, - std::shared_ptr summaryConfig) -{ - using TypeTag = Properties::TTag::EclFlowBrineProblem; - using Vanguard = GetPropType; - - Vanguard::setSetupTime(setupTime); - Vanguard::setDeck(std::move(deck)); - Vanguard::setEclState(std::move(eclState)); - Vanguard::setSchedule(std::move(schedule)); - Vanguard::setSummaryConfig(std::move(summaryConfig)); -} - // ----------------- Main program ----------------- int flowEbosBrineMain(int argc, char** argv, bool outputCout, bool outputFiles) diff --git a/flow/flow_ebos_brine.hpp b/flow/flow_ebos_brine.hpp index 12acd5198..9f885d166 100644 --- a/flow/flow_ebos_brine.hpp +++ b/flow/flow_ebos_brine.hpp @@ -17,20 +17,8 @@ #ifndef FLOW_EBOS_BRINE_HPP #define FLOW_EBOS_BRINE_HPP -#include - namespace Opm { -class Deck; -class EclipseState; -class Schedule; -class SummaryConfig; - -void flowEbosBrineSetDeck(double setupTime, std::shared_ptr deck, - std::shared_ptr eclState, - std::shared_ptr schedule, - std::shared_ptr summaryConfig); - //! \brief Main function used in flow binary. int flowEbosBrineMain(int argc, char** argv, bool outputCout, bool outputFiles); diff --git a/flow/flow_ebos_brine_precsalt_vapwat.cpp b/flow/flow_ebos_brine_precsalt_vapwat.cpp index 90cfb2998..0cbc2fc8e 100644 --- a/flow/flow_ebos_brine_precsalt_vapwat.cpp +++ b/flow/flow_ebos_brine_precsalt_vapwat.cpp @@ -47,21 +47,6 @@ struct EnableEvaporation { }} namespace Opm { -void flowEbosBrinePrecsaltVapwatSetDeck(double setupTime, std::shared_ptr deck, - std::shared_ptr eclState, - std::shared_ptr schedule, - std::shared_ptr summaryConfig) -{ - using TypeTag = Properties::TTag::EclFlowBrinePrecsaltVapwatProblem; - using Vanguard = GetPropType; - - Vanguard::setSetupTime(setupTime); - Vanguard::setDeck(std::move(deck)); - Vanguard::setEclState(std::move(eclState)); - Vanguard::setSchedule(std::move(schedule)); - Vanguard::setSummaryConfig(std::move(summaryConfig)); -} - // ----------------- Main program ----------------- int flowEbosBrinePrecsaltVapwatMain(int argc, char** argv, bool outputCout, bool outputFiles) diff --git a/flow/flow_ebos_brine_precsalt_vapwat.hpp b/flow/flow_ebos_brine_precsalt_vapwat.hpp index ffd316525..e333c9d68 100644 --- a/flow/flow_ebos_brine_precsalt_vapwat.hpp +++ b/flow/flow_ebos_brine_precsalt_vapwat.hpp @@ -17,20 +17,8 @@ #ifndef FLOW_EBOS_BRINE_PRECSALT_VAPWAT_HPP #define FLOW_EBOS_BRINE_PRECSALT_VAPWAT_HPP -#include - namespace Opm { -class Deck; -class EclipseState; -class Schedule; -class SummaryConfig; - -void flowEbosBrinePrecsaltVapwatSetDeck(double setupTime, std::shared_ptr deck, - std::shared_ptr eclState, - std::shared_ptr schedule, - std::shared_ptr summaryConfig); - //! \brief Main function used in flow binary. int flowEbosBrinePrecsaltVapwatMain(int argc, char** argv, bool outputCout, bool outputFiles); diff --git a/flow/flow_ebos_brine_saltprecipitation.cpp b/flow/flow_ebos_brine_saltprecipitation.cpp index 3371f97a2..fb260e541 100644 --- a/flow/flow_ebos_brine_saltprecipitation.cpp +++ b/flow/flow_ebos_brine_saltprecipitation.cpp @@ -42,21 +42,6 @@ struct EnableSaltPrecipitation deck, - std::shared_ptr eclState, - std::shared_ptr schedule, - std::shared_ptr summaryConfig) -{ - using TypeTag = Properties::TTag::EclFlowBrineSaltPrecipitationProblem; - using Vanguard = GetPropType; - - Vanguard::setSetupTime(setupTime); - Vanguard::setDeck(std::move(deck)); - Vanguard::setEclState(std::move(eclState)); - Vanguard::setSchedule(std::move(schedule)); - Vanguard::setSummaryConfig(std::move(summaryConfig)); -} - // ----------------- Main program ----------------- int flowEbosBrineSaltPrecipitationMain(int argc, char** argv, bool outputCout, bool outputFiles) diff --git a/flow/flow_ebos_brine_saltprecipitation.hpp b/flow/flow_ebos_brine_saltprecipitation.hpp index c3b8ffb10..0b18e94f1 100644 --- a/flow/flow_ebos_brine_saltprecipitation.hpp +++ b/flow/flow_ebos_brine_saltprecipitation.hpp @@ -21,16 +21,6 @@ namespace Opm { -class Deck; -class EclipseState; -class Schedule; -class SummaryConfig; - -void flowEbosBrineSaltPrecipitationSetDeck(double setupTime, std::shared_ptr deck, - std::shared_ptr eclState, - std::shared_ptr schedule, - std::shared_ptr summaryConfig); - //! \brief Main function used in flow binary. int flowEbosBrineSaltPrecipitationMain(int argc, char** argv, bool outputCout, bool outputFiles); diff --git a/flow/flow_ebos_energy.cpp b/flow/flow_ebos_energy.cpp index 3af0dce31..e4637d046 100644 --- a/flow/flow_ebos_energy.cpp +++ b/flow/flow_ebos_energy.cpp @@ -37,20 +37,6 @@ struct EnableEnergy { }} namespace Opm { -void flowEbosEnergySetDeck(double setupTime, std::shared_ptr deck, - std::shared_ptr eclState, - std::shared_ptr schedule, - std::shared_ptr summaryConfig) -{ - using TypeTag = Properties::TTag::EclFlowEnergyProblem; - using Vanguard = GetPropType; - - Vanguard::setSetupTime(setupTime); - Vanguard::setDeck(std::move(deck)); - Vanguard::setEclState(std::move(eclState)); - Vanguard::setSchedule(std::move(schedule)); - Vanguard::setSummaryConfig(std::move(summaryConfig)); -} // ----------------- Main program ----------------- int flowEbosEnergyMain(int argc, char** argv, bool outputCout, bool outputFiles) diff --git a/flow/flow_ebos_energy.hpp b/flow/flow_ebos_energy.hpp index 777401730..2e275b918 100644 --- a/flow/flow_ebos_energy.hpp +++ b/flow/flow_ebos_energy.hpp @@ -17,20 +17,8 @@ #ifndef FLOW_EBOS_ENERGY_HPP #define FLOW_EBOS_ENERGY_HPP -#include - namespace Opm { -class Deck; -class EclipseState; -class Schedule; -class SummaryConfig; - -void flowEbosEnergySetDeck(double setupTime, std::shared_ptr deck, - std::shared_ptr eclState, - std::shared_ptr schedule, - std::shared_ptr summaryConfig); - //! \brief Main function used in flow binary. int flowEbosEnergyMain(int argc, char** argv, bool outputCout, bool outputFiles); diff --git a/flow/flow_ebos_extbo.cpp b/flow/flow_ebos_extbo.cpp index 2ca964f40..c11eea52a 100644 --- a/flow/flow_ebos_extbo.cpp +++ b/flow/flow_ebos_extbo.cpp @@ -37,20 +37,6 @@ struct EnableExtbo { }} namespace Opm { -void flowEbosExtboSetDeck(double setupTime, std::shared_ptr deck, - std::shared_ptr eclState, - std::shared_ptr schedule, - std::shared_ptr summaryConfig) -{ - using TypeTag = Properties::TTag::EclFlowExtboProblem; - using Vanguard = GetPropType; - - Vanguard::setSetupTime(setupTime); - Vanguard::setDeck(std::move(deck)); - Vanguard::setEclState(std::move(eclState)); - Vanguard::setSchedule(std::move(schedule)); - Vanguard::setSummaryConfig(std::move(summaryConfig)); -} // ----------------- Main program ----------------- int flowEbosExtboMain(int argc, char** argv, bool outputCout, bool outputFiles) diff --git a/flow/flow_ebos_extbo.hpp b/flow/flow_ebos_extbo.hpp index 6d002d745..d1bba590f 100644 --- a/flow/flow_ebos_extbo.hpp +++ b/flow/flow_ebos_extbo.hpp @@ -17,20 +17,8 @@ #ifndef FLOW_EBOS_EXTBO_HPP #define FLOW_EBOS_EXTBO_HPP -#include - namespace Opm { -class Deck; -class EclipseState; -class Schedule; -class SummaryConfig; - -void flowEbosExtboSetDeck(double setupTime, std::shared_ptr deck, - std::shared_ptr eclState, - std::shared_ptr schedule, - std::shared_ptr summaryConfig); - //! \brief Main function used in flow binary. int flowEbosExtboMain(int argc, char** argv, bool outputCout, bool outputFiles); diff --git a/flow/flow_ebos_foam.cpp b/flow/flow_ebos_foam.cpp index a43c80aed..17e163810 100644 --- a/flow/flow_ebos_foam.cpp +++ b/flow/flow_ebos_foam.cpp @@ -37,21 +37,6 @@ struct EnableFoam { }} namespace Opm { -void flowEbosFoamSetDeck(double setupTime, std::shared_ptr deck, - std::shared_ptr eclState, - std::shared_ptr schedule, - std::shared_ptr summaryConfig) -{ - using TypeTag = Properties::TTag::EclFlowFoamProblem; - using Vanguard = GetPropType; - - Vanguard::setSetupTime(setupTime); - Vanguard::setDeck(std::move(deck)); - Vanguard::setEclState(std::move(eclState)); - Vanguard::setSchedule(std::move(schedule)); - Vanguard::setSummaryConfig(std::move(summaryConfig)); -} - // ----------------- Main program ----------------- int flowEbosFoamMain(int argc, char** argv, bool outputCout, bool outputFiles) diff --git a/flow/flow_ebos_foam.hpp b/flow/flow_ebos_foam.hpp index 58029b32f..275e330b1 100644 --- a/flow/flow_ebos_foam.hpp +++ b/flow/flow_ebos_foam.hpp @@ -17,20 +17,8 @@ #ifndef FLOW_EBOS_FOAM_HPP #define FLOW_EBOS_FOAM_HPP -#include - namespace Opm { -class Deck; -class EclipseState; -class Schedule; -class SummaryConfig; - -void flowEbosFoamSetDeck(double setupTime, std::shared_ptr deck, - std::shared_ptr eclState, - std::shared_ptr schedule, - std::shared_ptr summaryConfig); - //! \brief Main function used in flow binary. int flowEbosFoamMain(int argc, char** argv, bool outputCout, bool outputFiles); diff --git a/flow/flow_ebos_gasoil.cpp b/flow/flow_ebos_gasoil.cpp index 5c509af95..618ad3ec8 100644 --- a/flow/flow_ebos_gasoil.cpp +++ b/flow/flow_ebos_gasoil.cpp @@ -58,21 +58,6 @@ public: }} namespace Opm { -void flowEbosGasOilSetDeck(double setupTime, std::shared_ptr deck, - std::shared_ptr eclState, - std::shared_ptr schedule, - std::shared_ptr summaryConfig) -{ - using TypeTag = Properties::TTag::EclFlowGasOilProblem; - using Vanguard = GetPropType; - - Vanguard::setSetupTime(setupTime); - Vanguard::setDeck(std::move(deck)); - Vanguard::setEclState(std::move(eclState)); - Vanguard::setSchedule(std::move(schedule)); - Vanguard::setSummaryConfig(std::move(summaryConfig)); -} - // ----------------- Main program ----------------- int flowEbosGasOilMain(int argc, char** argv, bool outputCout, bool outputFiles) diff --git a/flow/flow_ebos_gasoil.hpp b/flow/flow_ebos_gasoil.hpp index 2f9d01a9d..c84ec249b 100644 --- a/flow/flow_ebos_gasoil.hpp +++ b/flow/flow_ebos_gasoil.hpp @@ -17,20 +17,8 @@ #ifndef FLOW_EBOS_GASOIL_HPP #define FLOW_EBOS_GASOIL_HPP -#include - namespace Opm { -class Deck; -class EclipseState; -class Schedule; -class SummaryConfig; - -void flowEbosGasOilSetDeck(double setupTime, std::shared_ptr deck, - std::shared_ptr eclState, - std::shared_ptr schedule, - std::shared_ptr summaryConfig); - //! \brief Main function used in flow binary. int flowEbosGasOilMain(int argc, char** argv, bool outputCout, bool outputFiles); diff --git a/flow/flow_ebos_gasoil_energy.cpp b/flow/flow_ebos_gasoil_energy.cpp index b9ec874c4..82f8fcaa7 100644 --- a/flow/flow_ebos_gasoil_energy.cpp +++ b/flow/flow_ebos_gasoil_energy.cpp @@ -62,21 +62,6 @@ struct EnableEnergy { }} namespace Opm { -void flowEbosGasOilEnergySetDeck(double setupTime, std::shared_ptr deck, - std::shared_ptr eclState, - std::shared_ptr schedule, - std::shared_ptr summaryConfig) -{ - using TypeTag = Properties::TTag::EclFlowGasOilEnergyProblem; - using Vanguard = GetPropType; - - Vanguard::setSetupTime(setupTime); - Vanguard::setDeck(std::move(deck)); - Vanguard::setEclState(std::move(eclState)); - Vanguard::setSchedule(std::move(schedule)); - Vanguard::setSummaryConfig(std::move(summaryConfig)); -} - // ----------------- Main program ----------------- int flowEbosGasOilEnergyMain(int argc, char** argv, bool outputCout, bool outputFiles) diff --git a/flow/flow_ebos_gasoil_energy.hpp b/flow/flow_ebos_gasoil_energy.hpp index f58d874b8..d126a0a21 100644 --- a/flow/flow_ebos_gasoil_energy.hpp +++ b/flow/flow_ebos_gasoil_energy.hpp @@ -17,20 +17,8 @@ #ifndef FLOW_EBOS_GASOIL_ENERGY_HPP #define FLOW_EBOS_GASOIL_ENERGY_HPP -#include - namespace Opm { -class Deck; -class EclipseState; -class Schedule; -class SummaryConfig; - -void flowEbosGasOilEnergySetDeck(double setupTime, std::shared_ptr deck, - std::shared_ptr eclState, - std::shared_ptr schedule, - std::shared_ptr summaryConfig); - //! \brief Main function used in flow binary. int flowEbosGasOilEnergyMain(int argc, char** argv, bool outputCout, bool outputFiles); diff --git a/flow/flow_ebos_gaswater.cpp b/flow/flow_ebos_gaswater.cpp index 390b252ed..f5491c805 100644 --- a/flow/flow_ebos_gaswater.cpp +++ b/flow/flow_ebos_gaswater.cpp @@ -61,20 +61,6 @@ public: }} namespace Opm { -void flowEbosGasWaterSetDeck(double setupTime, std::shared_ptr deck, - std::shared_ptr eclState, - std::shared_ptr schedule, - std::shared_ptr summaryConfig) -{ - using TypeTag = Properties::TTag::EclFlowGasWaterProblem; - using Vanguard = GetPropType; - - Vanguard::setSetupTime(setupTime); - Vanguard::setDeck(std::move(deck)); - Vanguard::setEclState(std::move(eclState)); - Vanguard::setSchedule(std::move(schedule)); - Vanguard::setSummaryConfig(std::move(summaryConfig)); -} // ----------------- Main program ----------------- diff --git a/flow/flow_ebos_gaswater.hpp b/flow/flow_ebos_gaswater.hpp index bcff482b5..4abca6aa4 100644 --- a/flow/flow_ebos_gaswater.hpp +++ b/flow/flow_ebos_gaswater.hpp @@ -17,20 +17,8 @@ #ifndef FLOW_EBOS_GASWATER_HPP #define FLOW_EBOS_GASWATER_HPP -#include - namespace Opm { -class Deck; -class EclipseState; -class Schedule; -class SummaryConfig; - -void flowEbosGasWaterSetDeck(double setupTime, std::shared_ptr deck, - std::shared_ptr eclState, - std::shared_ptr schedule, - std::shared_ptr summaryConfig); - //! \brief Main function used in flow binary. int flowEbosGasWaterMain(int argc, char** argv, bool outputCout, bool outputFiles); diff --git a/flow/flow_ebos_gaswater_brine.cpp b/flow/flow_ebos_gaswater_brine.cpp index e83fe9592..72257a271 100644 --- a/flow/flow_ebos_gaswater_brine.cpp +++ b/flow/flow_ebos_gaswater_brine.cpp @@ -61,20 +61,6 @@ public: }} namespace Opm { -void flowEbosGasWaterBrineSetDeck(double setupTime, std::shared_ptr deck, - std::shared_ptr eclState, - std::shared_ptr schedule, - std::shared_ptr summaryConfig) -{ - using TypeTag = Properties::TTag::EclFlowGasWaterBrineProblem; - using Vanguard = GetPropType; - - Vanguard::setSetupTime(setupTime); - Vanguard::setDeck(std::move(deck)); - Vanguard::setEclState(std::move(eclState)); - Vanguard::setSchedule(std::move(schedule)); - Vanguard::setSummaryConfig(std::move(summaryConfig)); -} // ----------------- Main program ----------------- int flowEbosGasWaterBrineMain(int argc, char** argv, bool outputCout, bool outputFiles) diff --git a/flow/flow_ebos_gaswater_brine.hpp b/flow/flow_ebos_gaswater_brine.hpp index 7dd467b18..af416fe8a 100644 --- a/flow/flow_ebos_gaswater_brine.hpp +++ b/flow/flow_ebos_gaswater_brine.hpp @@ -17,20 +17,8 @@ #ifndef FLOW_EBOS_GASWATER_BRINE_HPP #define FLOW_EBOS_GASWATER_BRINE_HPP -#include - namespace Opm { -class Deck; -class EclipseState; -class Schedule; -class SummaryConfig; - -void flowEbosGasWaterBrineSetDeck(double setupTime, std::shared_ptr deck, - std::shared_ptr eclState, - std::shared_ptr schedule, - std::shared_ptr summaryConfig); - //! \brief Main function used in flow binary. int flowEbosGasWaterBrineMain(int argc, char** argv, bool outputCout, bool outputFiles); diff --git a/flow/flow_ebos_gaswater_saltprec_vapwat.cpp b/flow/flow_ebos_gaswater_saltprec_vapwat.cpp index 594d2d67b..1a258b8b9 100644 --- a/flow/flow_ebos_gaswater_saltprec_vapwat.cpp +++ b/flow/flow_ebos_gaswater_saltprec_vapwat.cpp @@ -72,20 +72,6 @@ public: }} namespace Opm { -void flowEbosGasWaterSaltprecVapwatSetDeck(double setupTime, std::shared_ptr deck, - std::shared_ptr eclState, - std::shared_ptr schedule, - std::shared_ptr summaryConfig) -{ - using TypeTag = Properties::TTag::EclFlowGasWaterSaltprecVapwatProblem; - using Vanguard = GetPropType; - - Vanguard::setSetupTime(setupTime); - Vanguard::setDeck(std::move(deck)); - Vanguard::setEclState(std::move(eclState)); - Vanguard::setSchedule(std::move(schedule)); - Vanguard::setSummaryConfig(std::move(summaryConfig)); -} // ----------------- Main program ----------------- int flowEbosGasWaterSaltprecVapwatMain(int argc, char** argv, bool outputCout, bool outputFiles) diff --git a/flow/flow_ebos_gaswater_saltprec_vapwat.hpp b/flow/flow_ebos_gaswater_saltprec_vapwat.hpp index 1cb5da289..69b8af1d3 100644 --- a/flow/flow_ebos_gaswater_saltprec_vapwat.hpp +++ b/flow/flow_ebos_gaswater_saltprec_vapwat.hpp @@ -17,20 +17,8 @@ #ifndef FLOW_EBOS_GASWATERSALTPRECVAPWAT_BRINE_HPP #define FLOW_EBOS_GASWATERSALTPRECVAPWAT_BRINE_HPP -#include - namespace Opm { -class Deck; -class EclipseState; -class Schedule; -class SummaryConfig; - -void flowEbosGasWaterSaltprecVapwatSetDeck(double setupTime, std::shared_ptr deck, - std::shared_ptr eclState, - std::shared_ptr schedule, - std::shared_ptr summaryConfig); - //! \brief Main function used in flow binary. int flowEbosGasWaterSaltprecVapwatMain(int argc, char** argv, bool outputCout, bool outputFiles); diff --git a/flow/flow_ebos_micp.cpp b/flow/flow_ebos_micp.cpp index 364de710f..90c5260b0 100644 --- a/flow/flow_ebos_micp.cpp +++ b/flow/flow_ebos_micp.cpp @@ -61,20 +61,6 @@ public: }} namespace Opm { -void flowEbosMICPSetDeck(double setupTime, std::shared_ptr deck, - std::shared_ptr eclState, - std::shared_ptr schedule, - std::shared_ptr summaryConfig) -{ - using TypeTag = Properties::TTag::EclFlowMICPProblem; - using Vanguard = GetPropType; - - Vanguard::setSetupTime(setupTime); - Vanguard::setDeck(std::move(deck)); - Vanguard::setEclState(std::move(eclState)); - Vanguard::setSchedule(std::move(schedule)); - Vanguard::setSummaryConfig(std::move(summaryConfig)); -} // ----------------- Main program ----------------- int flowEbosMICPMain(int argc, char** argv, bool outputCout, bool outputFiles) diff --git a/flow/flow_ebos_micp.hpp b/flow/flow_ebos_micp.hpp index 77c608987..193a6f1dc 100644 --- a/flow/flow_ebos_micp.hpp +++ b/flow/flow_ebos_micp.hpp @@ -17,20 +17,8 @@ #ifndef FLOW_EBOS_MICP_HPP #define FLOW_EBOS_MICP_HPP -#include - namespace Opm { -class Deck; -class EclipseState; -class Schedule; -class SummaryConfig; - -void flowEbosMICPSetDeck(double setupTime, std::shared_ptr deck, - std::shared_ptr eclState, - std::shared_ptr schedule, - std::shared_ptr summaryConfig); - //! \brief Main function used in flow binary. int flowEbosMICPMain(int argc, char** argv, bool outputCout, bool outputFiles); diff --git a/flow/flow_ebos_oilwater.cpp b/flow/flow_ebos_oilwater.cpp index 4882e465d..4d8605a68 100644 --- a/flow/flow_ebos_oilwater.cpp +++ b/flow/flow_ebos_oilwater.cpp @@ -58,20 +58,6 @@ public: }} namespace Opm { -void flowEbosOilWaterSetDeck(double setupTime, std::shared_ptr deck, - std::shared_ptr eclState, - std::shared_ptr schedule, - std::shared_ptr summaryConfig) -{ - using TypeTag = Properties::TTag::EclFlowOilWaterProblem; - using Vanguard = GetPropType; - - Vanguard::setSetupTime(setupTime); - Vanguard::setDeck(std::move(deck)); - Vanguard::setEclState(std::move(eclState)); - Vanguard::setSchedule(std::move(schedule)); - Vanguard::setSummaryConfig(std::move(summaryConfig)); -} // ----------------- Main program ----------------- int flowEbosOilWaterMain(int argc, char** argv, bool outputCout, bool outputFiles) diff --git a/flow/flow_ebos_oilwater.hpp b/flow/flow_ebos_oilwater.hpp index e8efeffdc..205651782 100644 --- a/flow/flow_ebos_oilwater.hpp +++ b/flow/flow_ebos_oilwater.hpp @@ -17,20 +17,8 @@ #ifndef FLOW_EBOS_OILWATER_HPP #define FLOW_EBOS_OILWATER_HPP -#include - namespace Opm { -class Deck; -class EclipseState; -class Schedule; -class SummaryConfig; - -void flowEbosOilWaterSetDeck(double setupTime, std::shared_ptr deck, - std::shared_ptr eclState, - std::shared_ptr schedule, - std::shared_ptr summaryConfig); - //! \brief Main functon used in main flow binary. int flowEbosOilWaterMain(int argc, char** argv, bool outputCout, bool outputFiles); diff --git a/flow/flow_ebos_oilwater_brine.cpp b/flow/flow_ebos_oilwater_brine.cpp index fd603e905..e8002cfa1 100644 --- a/flow/flow_ebos_oilwater_brine.cpp +++ b/flow/flow_ebos_oilwater_brine.cpp @@ -61,20 +61,6 @@ public: }} namespace Opm { -void flowEbosOilWaterBrineSetDeck(double setupTime, std::shared_ptr deck, - std::shared_ptr eclState, - std::shared_ptr schedule, - std::shared_ptr summaryConfig) -{ - using TypeTag = Properties::TTag::EclFlowOilWaterBrineProblem; - using Vanguard = GetPropType; - - Vanguard::setSetupTime(setupTime); - Vanguard::setDeck(std::move(deck)); - Vanguard::setEclState(std::move(eclState)); - Vanguard::setSchedule(std::move(schedule)); - Vanguard::setSummaryConfig(std::move(summaryConfig)); -} // ----------------- Main program ----------------- int flowEbosOilWaterBrineMain(int argc, char** argv, bool outputCout, bool outputFiles) diff --git a/flow/flow_ebos_oilwater_brine.hpp b/flow/flow_ebos_oilwater_brine.hpp index 0f6ebb361..66e41554d 100644 --- a/flow/flow_ebos_oilwater_brine.hpp +++ b/flow/flow_ebos_oilwater_brine.hpp @@ -17,20 +17,8 @@ #ifndef FLOW_EBOS_OILWATER_BRINE_HPP #define FLOW_EBOS_OILWATER_BRINE_HPP -#include - namespace Opm { -class Deck; -class EclipseState; -class Schedule; -class SummaryConfig; - -void flowEbosOilWaterBrineSetDeck(double setupTime, std::shared_ptr deck, - std::shared_ptr eclState, - std::shared_ptr schedule, - std::shared_ptr summaryConfig); - //! \brief Main function used in flow binary. int flowEbosOilWaterBrineMain(int argc, char** argv, bool outputCout, bool outputFiles); diff --git a/flow/flow_ebos_oilwater_polymer.cpp b/flow/flow_ebos_oilwater_polymer.cpp index 9479b08dc..6daf72365 100644 --- a/flow/flow_ebos_oilwater_polymer.cpp +++ b/flow/flow_ebos_oilwater_polymer.cpp @@ -61,20 +61,6 @@ public: }} namespace Opm { -void flowEbosOilWaterPolymerSetDeck(double setupTime, std::shared_ptr deck, - std::shared_ptr eclState, - std::shared_ptr schedule, - std::shared_ptr summaryConfig) -{ - using TypeTag = Properties::TTag::EclFlowOilWaterPolymerProblem; - using Vanguard = GetPropType; - - Vanguard::setSetupTime(setupTime); - Vanguard::setDeck(std::move(deck)); - Vanguard::setEclState(std::move(eclState)); - Vanguard::setSchedule(std::move(schedule)); - Vanguard::setSummaryConfig(std::move(summaryConfig)); -} // ----------------- Main program ----------------- int flowEbosOilWaterPolymerMain(int argc, char** argv, bool outputCout, bool outputFiles) diff --git a/flow/flow_ebos_oilwater_polymer.hpp b/flow/flow_ebos_oilwater_polymer.hpp index 1c48a7bea..163eee207 100644 --- a/flow/flow_ebos_oilwater_polymer.hpp +++ b/flow/flow_ebos_oilwater_polymer.hpp @@ -17,20 +17,8 @@ #ifndef FLOW_EBOS_OILWATER_POLYMER_HPP #define FLOW_EBOS_OILWATER_POLYMER_HPP -#include - namespace Opm { -class Deck; -class EclipseState; -class Schedule; -class SummaryConfig; - -void flowEbosOilWaterPolymerSetDeck(double setupTime, std::shared_ptr deck, - std::shared_ptr eclState, - std::shared_ptr schedule, - std::shared_ptr summaryConfig); - //! \brief Main functon used in main flow binary. int flowEbosOilWaterPolymerMain(int argc, char** argv, bool outputCout, bool outputFiles); diff --git a/flow/flow_ebos_onephase.cpp b/flow/flow_ebos_onephase.cpp index dcd441641..3419793b5 100644 --- a/flow/flow_ebos_onephase.cpp +++ b/flow/flow_ebos_onephase.cpp @@ -57,21 +57,6 @@ public: } // namespace Opm::Properties -void flowEbosWaterOnlySetDeck(double setupTime, std::shared_ptr deck, - std::shared_ptr eclState, - std::shared_ptr schedule, - std::shared_ptr summaryConfig) -{ - using TypeTag = Properties::TTag::EclFlowProblemWaterOnly; - using Vanguard = GetPropType; - - Vanguard::setSetupTime(setupTime); - Vanguard::setDeck(std::move(deck)); - Vanguard::setEclState(std::move(eclState)); - Vanguard::setSchedule(std::move(schedule)); - Vanguard::setSummaryConfig(std::move(summaryConfig)); -} - // ----------------- Main program ----------------- int flowEbosWaterOnlyMain(int argc, char** argv, bool outputCout, bool outputFiles) { diff --git a/flow/flow_ebos_onephase.hpp b/flow/flow_ebos_onephase.hpp index 9bd45262d..3a7b4db92 100644 --- a/flow/flow_ebos_onephase.hpp +++ b/flow/flow_ebos_onephase.hpp @@ -22,26 +22,12 @@ #ifndef FLOW_ONEPHASE_HPP #define FLOW_ONEPHASE_HPP -#include - namespace Opm { -class Deck; -class EclipseState; -template class FlowMainEbos; -class Schedule; -class SummaryConfig; -class UDQState; -class WellTestState; -namespace Action { -class State; -} - -void flowEbosWaterOnlySetDeck(double setupTime, std::shared_ptr deck, - std::shared_ptr eclState, - std::shared_ptr schedule, - std::shared_ptr summaryConfig); +//! \brief Main functon used in main flow binary. int flowEbosWaterOnlyMain(int argc, char** argv, bool outputCout, bool outputFiles); + +//! \brief Main function used in flow_onephase binary. int flowEbosWaterOnlyMainStandalone(int argc, char** argv); } diff --git a/flow/flow_ebos_onephase_energy.cpp b/flow/flow_ebos_onephase_energy.cpp index 9f50eb9b2..b2acd8630 100644 --- a/flow/flow_ebos_onephase_energy.cpp +++ b/flow/flow_ebos_onephase_energy.cpp @@ -64,21 +64,6 @@ public: } // namespace Opm::Properties -void flowEbosWaterOnlyEnergySetDeck(double setupTime, std::shared_ptr deck, - std::shared_ptr eclState, - std::shared_ptr schedule, - std::shared_ptr summaryConfig) -{ - using TypeTag = Properties::TTag::EclFlowProblemWaterOnlyEnergy; - using Vanguard = GetPropType; - - Vanguard::setSetupTime(setupTime); - Vanguard::setDeck(std::move(deck)); - Vanguard::setEclState(std::move(eclState)); - Vanguard::setSchedule(std::move(schedule)); - Vanguard::setSummaryConfig(std::move(summaryConfig)); -} - // ----------------- Main program ----------------- int flowEbosWaterOnlyEnergyMain(int argc, char** argv, bool outputCout, bool outputFiles) { diff --git a/flow/flow_ebos_onephase_energy.hpp b/flow/flow_ebos_onephase_energy.hpp index 657bf529b..5e32654a3 100644 --- a/flow/flow_ebos_onephase_energy.hpp +++ b/flow/flow_ebos_onephase_energy.hpp @@ -22,27 +22,14 @@ #ifndef FLOW_ONEPHASE_ENERGY_HPP #define FLOW_ONEPHASE_ENERGY_HPP -#include - namespace Opm { -class Deck; -class EclipseState; -template class FlowMainEbos; -class Schedule; -class SummaryConfig; -class UDQState; -class WellTestState; -namespace Action { -class State; -} - -void flowEbosWaterOnlyEnergySetDeck(double setupTime, std::shared_ptr deck, - std::shared_ptr eclState, - std::shared_ptr schedule, - std::shared_ptr summaryConfig); +//! \brief Main functon used in main flow binary. int flowEbosWaterOnlyEnergyMain(int argc, char** argv, bool outputCout, bool outputFiles); + +//! \brief Main function used in flow_onephase_energy binary. int flowEbosWaterOnlyEnergyMainStandalone(int argc, char** argv); + } #endif diff --git a/flow/flow_ebos_polymer.cpp b/flow/flow_ebos_polymer.cpp index f39d46533..68752429d 100644 --- a/flow/flow_ebos_polymer.cpp +++ b/flow/flow_ebos_polymer.cpp @@ -37,20 +37,6 @@ struct EnablePolymer { }} namespace Opm { -void flowEbosPolymerSetDeck(double setupTime, std::shared_ptr deck, - std::shared_ptr eclState, - std::shared_ptr schedule, - std::shared_ptr summaryConfig) -{ - using TypeTag = Properties::TTag::EclFlowPolymerProblem; - using Vanguard = GetPropType; - - Vanguard::setSetupTime(setupTime); - Vanguard::setDeck(std::move(deck)); - Vanguard::setEclState(std::move(eclState)); - Vanguard::setSchedule(std::move(schedule)); - Vanguard::setSummaryConfig(std::move(summaryConfig)); -} // ----------------- Main program ----------------- int flowEbosPolymerMain(int argc, char** argv, bool outputCout, bool outputFiles) diff --git a/flow/flow_ebos_polymer.hpp b/flow/flow_ebos_polymer.hpp index b5a976a74..54900c38f 100644 --- a/flow/flow_ebos_polymer.hpp +++ b/flow/flow_ebos_polymer.hpp @@ -17,20 +17,8 @@ #ifndef FLOW_EBOS_POLYMER_HPP #define FLOW_EBOS_POLYMER_HPP -#include - namespace Opm { -class Deck; -class EclipseState; -class Schedule; -class SummaryConfig; - -void flowEbosPolymerSetDeck(double setupTime, std::shared_ptr deck, - std::shared_ptr eclState, - std::shared_ptr schedule, - std::shared_ptr summaryConfig); - //! \brief Main function used in flow binary. int flowEbosPolymerMain(int argc, char** argv, bool outputCout, bool outputFiles); diff --git a/flow/flow_ebos_solvent.cpp b/flow/flow_ebos_solvent.cpp index 60e1604f5..2c393f54b 100644 --- a/flow/flow_ebos_solvent.cpp +++ b/flow/flow_ebos_solvent.cpp @@ -37,21 +37,6 @@ struct EnableSolvent { }} namespace Opm { -void flowEbosSolventSetDeck(double setupTime, std::shared_ptr deck, - std::shared_ptr eclState, - std::shared_ptr schedule, - std::shared_ptr summaryConfig) -{ - using TypeTag = Properties::TTag::EclFlowSolventProblem; - using Vanguard = GetPropType; - - Vanguard::setSetupTime(setupTime); - Vanguard::setDeck(std::move(deck)); - Vanguard::setEclState(std::move(eclState)); - Vanguard::setSchedule(std::move(schedule)); - Vanguard::setSummaryConfig(std::move(summaryConfig)); -} - // ----------------- Main program ----------------- int flowEbosSolventMain(int argc, char** argv, bool outputCout, bool outputFiles) diff --git a/flow/flow_ebos_solvent.hpp b/flow/flow_ebos_solvent.hpp index ed2614a19..abf828e29 100644 --- a/flow/flow_ebos_solvent.hpp +++ b/flow/flow_ebos_solvent.hpp @@ -17,20 +17,8 @@ #ifndef FLOW_EBOS_SOLVENT_HPP #define FLOW_EBOS_SOLVENT_HPP -#include - namespace Opm { -class Deck; -class EclipseState; -class Schedule; -class SummaryConfig; - -void flowEbosSolventSetDeck(double setupTime, std::shared_ptr deck, - std::shared_ptr eclState, - std::shared_ptr schedule, - std::shared_ptr summaryConfig); - //! \brief Main function used in flow binary. int flowEbosSolventMain(int argc, char** argv, bool outoutCout, bool outputFiles); diff --git a/opm/simulators/flow/Main.hpp b/opm/simulators/flow/Main.hpp index 0236875f0..43c51f9c4 100644 --- a/opm/simulators/flow/Main.hpp +++ b/opm/simulators/flow/Main.hpp @@ -96,20 +96,6 @@ struct FlowEarlyBird { namespace Opm { -template -void flowEbosSetDeck(std::shared_ptr deck, - std::shared_ptr eclState, - std::shared_ptr schedule, - std::shared_ptr summaryConfig) -{ - using Vanguard = GetPropType; - - Vanguard::setDeck(deck); - Vanguard::setEclState(eclState); - Vanguard::setSchedule(schedule); - Vanguard::setSummaryConfig(summaryConfig); -} - // ----------------- Main program ----------------- template int flowEbosMain(int argc, char** argv, bool outputCout, bool outputFiles) @@ -260,7 +246,7 @@ public: if (initialize_(exitCode)) { // TODO: check that this deck really represents a blackoil // case. E.g. check that number of phases == 3 - flowEbosBlackoilSetDeck( + EclGenericVanguard::setParams( setupTime_, deck_, eclipseState_, @@ -283,6 +269,15 @@ private: const auto& rspec = this->eclipseState_->runspec(); const auto& phases = rspec.phases(); + EclGenericVanguard::setParams(this->setupTime_, + this->deck_, + this->eclipseState_, + this->schedule_, + std::move(this->udqState_), + std::move(this->actionState_), + std::move(this->wtestState_), + this->summaryConfig_); + // run the actual simulator // // TODO: make sure that no illegal combinations like thermal and @@ -357,8 +352,14 @@ private: template int dispatchStatic_() { - flowEbosSetDeck( - deck_, eclipseState_, schedule_, summaryConfig_); + EclGenericVanguard::setParams(this->setupTime_, + this->deck_, + this->eclipseState_, + this->schedule_, + std::move(this->udqState_), + std::move(this->actionState_), + std::move(this->wtestState_), + this->summaryConfig_); return flowEbosMain(argc_, argv_, outputCout_, outputFiles_); } @@ -584,12 +585,6 @@ private: return EXIT_FAILURE; } - flowEbosMICPSetDeck(this->setupTime_, - this->deck_, - this->eclipseState_, - this->schedule_, - this->summaryConfig_); - return flowEbosMICPMain(this->argc_, this->argv_, this->outputCout_, @@ -600,22 +595,16 @@ private: { // oil-gas if (phases.active( Phase::OIL ) && phases.active( Phase::GAS )) { - flowEbosGasOilSetDeck( - setupTime_, deck_, eclipseState_, schedule_, summaryConfig_); return flowEbosGasOilMain(argc_, argv_, outputCout_, outputFiles_); } // oil-water else if ( phases.active( Phase::OIL ) && phases.active( Phase::WATER ) ) { - flowEbosOilWaterSetDeck( - setupTime_, deck_, eclipseState_, schedule_, summaryConfig_); return flowEbosOilWaterMain(argc_, argv_, outputCout_, outputFiles_); } // gas-water else if ( phases.active( Phase::GAS ) && phases.active( Phase::WATER ) ) { - flowEbosGasWaterSetDeck( - setupTime_, deck_, eclipseState_, schedule_, summaryConfig_); return flowEbosGasWaterMain(argc_, argv_, outputCout_, outputFiles_); } else { @@ -646,22 +635,15 @@ private: } if (phases.size() == 3) { // oil water polymer case - flowEbosOilWaterPolymerSetDeck( - setupTime_, deck_, eclipseState_, schedule_, summaryConfig_); return flowEbosOilWaterPolymerMain(argc_, argv_, outputCout_, outputFiles_); } else { - flowEbosPolymerSetDeck( - setupTime_, deck_, eclipseState_, schedule_, summaryConfig_); return flowEbosPolymerMain(argc_, argv_, outputCout_, outputFiles_); } } int runFoam() { - flowEbosFoamSetDeck( - setupTime_, deck_, eclipseState_, schedule_, summaryConfig_); - return flowEbosFoamMain(argc_, argv_, outputCout_, outputFiles_); } @@ -674,8 +656,6 @@ private: return EXIT_FAILURE; } - flowEbosWaterOnlySetDeck( - setupTime_, deck_, eclipseState_, schedule_, summaryConfig_); return flowEbosWaterOnlyMain(argc_, argv_, outputCout_, outputFiles_); } @@ -689,8 +669,6 @@ private: return EXIT_FAILURE; } - flowEbosWaterOnlyEnergySetDeck( - setupTime_, deck_, eclipseState_, schedule_, summaryConfig_); return flowEbosWaterOnlyEnergyMain(argc_, argv_, outputCout_, outputFiles_); } @@ -708,21 +686,15 @@ private: if (phases.size() == 3) { if (phases.active(Phase::OIL)){ // oil water brine case - flowEbosOilWaterBrineSetDeck( - setupTime_, deck_, eclipseState_, schedule_, summaryConfig_); return flowEbosOilWaterBrineMain(argc_, argv_, outputCout_, outputFiles_); } if (phases.active(Phase::GAS)){ // gas water brine case if (eclipseState_->getSimulationConfig().hasPRECSALT() && eclipseState_->getSimulationConfig().hasVAPWAT()) { //case with water vaporization into gas phase and salt precipitation - flowEbosGasWaterSaltprecVapwatSetDeck( - setupTime_, deck_, eclipseState_, schedule_, summaryConfig_); - return flowEbosGasWaterSaltprecVapwatMain(argc_, argv_, outputCout_, outputFiles_); + return flowEbosGasWaterSaltprecVapwatMain(argc_, argv_, outputCout_, outputFiles_); } else { - flowEbosGasWaterBrineSetDeck( - setupTime_, deck_, eclipseState_, schedule_, summaryConfig_); return flowEbosGasWaterBrineMain(argc_, argv_, outputCout_, outputFiles_); } } @@ -730,19 +702,13 @@ private: else if (eclipseState_->getSimulationConfig().hasPRECSALT()) { if (eclipseState_->getSimulationConfig().hasVAPWAT()) { //case with water vaporization into gas phase and salt precipitation - flowEbosBrinePrecsaltVapwatSetDeck( - setupTime_, deck_, eclipseState_, schedule_, summaryConfig_); return flowEbosBrinePrecsaltVapwatMain(argc_, argv_, outputCout_, outputFiles_); } else { - flowEbosBrineSaltPrecipitationSetDeck( - setupTime_, deck_, eclipseState_, schedule_, summaryConfig_); return flowEbosBrineSaltPrecipitationMain(argc_, argv_, outputCout_, outputFiles_); } } else { - flowEbosBrineSetDeck( - setupTime_, deck_, eclipseState_, schedule_, summaryConfig_); return flowEbosBrineMain(argc_, argv_, outputCout_, outputFiles_); } @@ -751,17 +717,11 @@ private: int runSolvent() { - flowEbosSolventSetDeck( - setupTime_, deck_, eclipseState_, schedule_, summaryConfig_); - return flowEbosSolventMain(argc_, argv_, outputCout_, outputFiles_); } int runExtendedBlackOil() { - flowEbosExtboSetDeck( - setupTime_, deck_, eclipseState_, schedule_, summaryConfig_); - return flowEbosExtboMain(argc_, argv_, outputCout_, outputFiles_); } @@ -769,28 +729,14 @@ private: { // oil-gas-thermal if (!phases.active( Phase::WATER ) && phases.active( Phase::OIL ) && phases.active( Phase::GAS )) { - flowEbosGasOilEnergySetDeck( - setupTime_, deck_, eclipseState_, schedule_, summaryConfig_); return flowEbosGasOilEnergyMain(argc_, argv_, outputCout_, outputFiles_); } - flowEbosEnergySetDeck( - setupTime_, deck_, eclipseState_, schedule_, summaryConfig_); - return flowEbosEnergyMain(argc_, argv_, outputCout_, outputFiles_); } int runBlackOil() { - flowEbosBlackoilSetDeck(this->setupTime_, - this->deck_, - this->eclipseState_, - this->schedule_, - std::move(this->udqState_), - std::move(this->actionState_), - std::move(this->wtestState_), - this->summaryConfig_); - return flowEbosBlackoilMain(argc_, argv_, outputCout_, outputFiles_); }