From 68a9d17de1e47fd73f33edeedf903964806c3894 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Wed, 22 Jan 2020 10:17:02 +0100 Subject: [PATCH] changed: pass/store deck as a pointer and remove asserts for null-ptr. preparatory step for only having deck on root mpi process --- ebos/eclbasevanguard.hh | 2 -- flow/flow.cpp | 18 +++++++++--------- flow/flow_ebos_blackoil.cpp | 4 ++-- flow/flow_ebos_blackoil.hpp | 2 +- flow/flow_ebos_brine.cpp | 4 ++-- flow/flow_ebos_brine.hpp | 2 +- flow/flow_ebos_energy.cpp | 4 ++-- flow/flow_ebos_energy.hpp | 2 +- flow/flow_ebos_foam.cpp | 4 ++-- flow/flow_ebos_foam.hpp | 2 +- flow/flow_ebos_gasoil.cpp | 4 ++-- flow/flow_ebos_gasoil.hpp | 2 +- flow/flow_ebos_oilwater.cpp | 4 ++-- flow/flow_ebos_oilwater.hpp | 2 +- flow/flow_ebos_oilwater_polymer.cpp | 4 ++-- flow/flow_ebos_oilwater_polymer.hpp | 2 +- flow/flow_ebos_polymer.cpp | 4 ++-- flow/flow_ebos_polymer.hpp | 2 +- flow/flow_ebos_solvent.cpp | 4 ++-- flow/flow_ebos_solvent.hpp | 2 +- 20 files changed, 36 insertions(+), 38 deletions(-) diff --git a/ebos/eclbasevanguard.hh b/ebos/eclbasevanguard.hh index 9bd3fa268..d02d46d44 100644 --- a/ebos/eclbasevanguard.hh +++ b/ebos/eclbasevanguard.hh @@ -322,7 +322,6 @@ public: Opm::checkDeck(*deck_, parser, *parseContext_, *errorGuard_); } else { - assert(externalDeck_); deck_ = externalDeck_; } @@ -331,7 +330,6 @@ public: eclState_ = internalEclState_.get(); } else { - assert(externalDeck_); assert(externalEclState_); deck_ = externalDeck_; diff --git a/flow/flow.cpp b/flow/flow.cpp index ff6cdc37f..7f6d07605 100644 --- a/flow/flow.cpp +++ b/flow/flow.cpp @@ -410,13 +410,13 @@ int main(int argc, char** argv) // oil-gas if (phases.active( Opm::Phase::GAS )) { - Opm::flowEbosGasOilSetDeck(externalSetupTimer.elapsed(), *deck, *eclipseState, *schedule, *summaryConfig); + Opm::flowEbosGasOilSetDeck(externalSetupTimer.elapsed(), deck.get(), *eclipseState, *schedule, *summaryConfig); return Opm::flowEbosGasOilMain(argc, argv, outputCout, outputFiles); } // oil-water else if ( phases.active( Opm::Phase::WATER ) ) { - Opm::flowEbosOilWaterSetDeck(externalSetupTimer.elapsed(), *deck, *eclipseState, *schedule, *summaryConfig); + Opm::flowEbosOilWaterSetDeck(externalSetupTimer.elapsed(), deck.get(), *eclipseState, *schedule, *summaryConfig); return Opm::flowEbosOilWaterMain(argc, argv, outputCout, outputFiles); } else { @@ -444,37 +444,37 @@ int main(int argc, char** argv) } if ( phases.size() == 3 ) { // oil water polymer case - Opm::flowEbosOilWaterPolymerSetDeck(externalSetupTimer.elapsed(), *deck, *eclipseState, *schedule, *summaryConfig); + Opm::flowEbosOilWaterPolymerSetDeck(externalSetupTimer.elapsed(), deck.get(), *eclipseState, *schedule, *summaryConfig); return Opm::flowEbosOilWaterPolymerMain(argc, argv, outputCout, outputFiles); } else { - Opm::flowEbosPolymerSetDeck(externalSetupTimer.elapsed(), *deck, *eclipseState, *schedule, *summaryConfig); + Opm::flowEbosPolymerSetDeck(externalSetupTimer.elapsed(), deck.get(), *eclipseState, *schedule, *summaryConfig); return Opm::flowEbosPolymerMain(argc, argv, outputCout, outputFiles); } } // Foam case else if ( phases.active( Opm::Phase::FOAM ) ) { - Opm::flowEbosFoamSetDeck(externalSetupTimer.elapsed(), *deck, *eclipseState, *schedule, *summaryConfig); + Opm::flowEbosFoamSetDeck(externalSetupTimer.elapsed(), deck.get(), *eclipseState, *schedule, *summaryConfig); return Opm::flowEbosFoamMain(argc, argv, outputCout, outputFiles); } // Brine case else if ( phases.active( Opm::Phase::BRINE ) ) { - Opm::flowEbosBrineSetDeck(externalSetupTimer.elapsed(), *deck, *eclipseState, *schedule, *summaryConfig); + Opm::flowEbosBrineSetDeck(externalSetupTimer.elapsed(), deck.get(), *eclipseState, *schedule, *summaryConfig); return Opm::flowEbosBrineMain(argc, argv, outputCout, outputFiles); } // Solvent case else if ( phases.active( Opm::Phase::SOLVENT ) ) { - Opm::flowEbosSolventSetDeck(externalSetupTimer.elapsed(), *deck, *eclipseState, *schedule, *summaryConfig); + Opm::flowEbosSolventSetDeck(externalSetupTimer.elapsed(), deck.get(), *eclipseState, *schedule, *summaryConfig); return Opm::flowEbosSolventMain(argc, argv, outputCout, outputFiles); } // Energy case else if (eclipseState->getSimulationConfig().isThermal()) { - Opm::flowEbosEnergySetDeck(externalSetupTimer.elapsed(), *deck, *eclipseState, *schedule, *summaryConfig); + Opm::flowEbosEnergySetDeck(externalSetupTimer.elapsed(), deck.get(), *eclipseState, *schedule, *summaryConfig); return Opm::flowEbosEnergyMain(argc, argv, outputCout, outputFiles); } #endif // FLOW_BLACKOIL_ONLY // Blackoil case else if( phases.size() == 3 ) { - Opm::flowEbosBlackoilSetDeck(externalSetupTimer.elapsed(), *deck, *eclipseState, *schedule, *summaryConfig); + Opm::flowEbosBlackoilSetDeck(externalSetupTimer.elapsed(), deck.get(), *eclipseState, *schedule, *summaryConfig); return Opm::flowEbosBlackoilMain(argc, argv, outputCout, outputFiles); } else diff --git a/flow/flow_ebos_blackoil.cpp b/flow/flow_ebos_blackoil.cpp index 9558de347..809610682 100644 --- a/flow/flow_ebos_blackoil.cpp +++ b/flow/flow_ebos_blackoil.cpp @@ -34,13 +34,13 @@ namespace Opm { -void flowEbosBlackoilSetDeck(double setupTime, Deck &deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig) +void flowEbosBlackoilSetDeck(double setupTime, Deck *deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig) { typedef TTAG(EclFlowProblem) TypeTag; typedef GET_PROP_TYPE(TypeTag, Vanguard) Vanguard; Vanguard::setExternalSetupTime(setupTime); - Vanguard::setExternalDeck(&deck); + Vanguard::setExternalDeck(deck); Vanguard::setExternalEclState(&eclState); Vanguard::setExternalSchedule(&schedule); Vanguard::setExternalSummaryConfig(&summaryConfig); diff --git a/flow/flow_ebos_blackoil.hpp b/flow/flow_ebos_blackoil.hpp index 703326fc8..641d74aa2 100644 --- a/flow/flow_ebos_blackoil.hpp +++ b/flow/flow_ebos_blackoil.hpp @@ -23,7 +23,7 @@ #include namespace Opm { -void flowEbosBlackoilSetDeck(double setupTime, Deck &deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig); +void flowEbosBlackoilSetDeck(double setupTime, Deck *deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig); 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 484091161..c39379d49 100644 --- a/flow/flow_ebos_brine.cpp +++ b/flow/flow_ebos_brine.cpp @@ -36,13 +36,13 @@ SET_BOOL_PROP(EclFlowBrineProblem, EnableBrine, true); }} namespace Opm { -void flowEbosBrineSetDeck(double setupTime, Deck &deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig) +void flowEbosBrineSetDeck(double setupTime, Deck *deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig) { typedef TTAG(EclFlowBrineProblem) TypeTag; typedef GET_PROP_TYPE(TypeTag, Vanguard) Vanguard; Vanguard::setExternalSetupTime(setupTime); - Vanguard::setExternalDeck(&deck); + Vanguard::setExternalDeck(deck); Vanguard::setExternalEclState(&eclState); Vanguard::setExternalSchedule(&schedule); Vanguard::setExternalSummaryConfig(&summaryConfig); diff --git a/flow/flow_ebos_brine.hpp b/flow/flow_ebos_brine.hpp index 0f974f524..4b8df12ce 100644 --- a/flow/flow_ebos_brine.hpp +++ b/flow/flow_ebos_brine.hpp @@ -24,7 +24,7 @@ namespace Opm { -void flowEbosBrineSetDeck(double setupTime, Deck &deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig); +void flowEbosBrineSetDeck(double setupTime, Deck *deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig); int flowEbosBrineMain(int argc, char** argv, bool outputCout, bool outputFiles); } diff --git a/flow/flow_ebos_energy.cpp b/flow/flow_ebos_energy.cpp index 6fd2cb949..30f2506f7 100644 --- a/flow/flow_ebos_energy.cpp +++ b/flow/flow_ebos_energy.cpp @@ -36,13 +36,13 @@ SET_BOOL_PROP(EclFlowEnergyProblem, EnableEnergy, true); }} namespace Opm { -void flowEbosEnergySetDeck(double setupTime, Deck &deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig) +void flowEbosEnergySetDeck(double setupTime, Deck *deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig) { typedef TTAG(EclFlowEnergyProblem) TypeTag; typedef GET_PROP_TYPE(TypeTag, Vanguard) Vanguard; Vanguard::setExternalSetupTime(setupTime); - Vanguard::setExternalDeck(&deck); + Vanguard::setExternalDeck(deck); Vanguard::setExternalEclState(&eclState); Vanguard::setExternalSchedule(&schedule); Vanguard::setExternalSummaryConfig(&summaryConfig); diff --git a/flow/flow_ebos_energy.hpp b/flow/flow_ebos_energy.hpp index 58e091e78..6c02e4b35 100644 --- a/flow/flow_ebos_energy.hpp +++ b/flow/flow_ebos_energy.hpp @@ -23,7 +23,7 @@ #include namespace Opm { -void flowEbosEnergySetDeck(double setupTime, Deck &deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig); +void flowEbosEnergySetDeck(double setupTime, Deck *deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig); int flowEbosEnergyMain(int argc, char** argv, bool outputCout, bool outputFiles); } diff --git a/flow/flow_ebos_foam.cpp b/flow/flow_ebos_foam.cpp index 9037c5622..973617666 100644 --- a/flow/flow_ebos_foam.cpp +++ b/flow/flow_ebos_foam.cpp @@ -36,13 +36,13 @@ SET_BOOL_PROP(EclFlowFoamProblem, EnableFoam, true); }} namespace Opm { -void flowEbosFoamSetDeck(double setupTime, Deck &deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig) +void flowEbosFoamSetDeck(double setupTime, Deck *deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig) { typedef TTAG(EclFlowFoamProblem) TypeTag; typedef GET_PROP_TYPE(TypeTag, Vanguard) Vanguard; Vanguard::setExternalSetupTime(setupTime); - Vanguard::setExternalDeck(&deck); + Vanguard::setExternalDeck(deck); Vanguard::setExternalEclState(&eclState); Vanguard::setExternalSchedule(&schedule); Vanguard::setExternalSummaryConfig(&summaryConfig); diff --git a/flow/flow_ebos_foam.hpp b/flow/flow_ebos_foam.hpp index e35734743..0ad4d750a 100644 --- a/flow/flow_ebos_foam.hpp +++ b/flow/flow_ebos_foam.hpp @@ -24,7 +24,7 @@ namespace Opm { -void flowEbosFoamSetDeck(double setupTime, Deck &deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig); +void flowEbosFoamSetDeck(double setupTime, Deck *deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig); 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 32fd14f50..989f889db 100644 --- a/flow/flow_ebos_gasoil.cpp +++ b/flow/flow_ebos_gasoil.cpp @@ -60,13 +60,13 @@ public: }} namespace Opm { -void flowEbosGasOilSetDeck(double setupTime, Deck &deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig) +void flowEbosGasOilSetDeck(double setupTime, Deck *deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig) { typedef TTAG(EclFlowGasOilProblem) TypeTag; typedef GET_PROP_TYPE(TypeTag, Vanguard) Vanguard; Vanguard::setExternalSetupTime(setupTime); - Vanguard::setExternalDeck(&deck); + Vanguard::setExternalDeck(deck); Vanguard::setExternalEclState(&eclState); Vanguard::setExternalSchedule(&schedule); Vanguard::setExternalSummaryConfig(&summaryConfig); diff --git a/flow/flow_ebos_gasoil.hpp b/flow/flow_ebos_gasoil.hpp index ea5746bf4..da2c09551 100644 --- a/flow/flow_ebos_gasoil.hpp +++ b/flow/flow_ebos_gasoil.hpp @@ -23,7 +23,7 @@ #include namespace Opm { -void flowEbosGasOilSetDeck(double setupTime, Deck &deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig); +void flowEbosGasOilSetDeck(double setupTime, Deck *deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig); int flowEbosGasOilMain(int argc, char** argv, bool outputCout, bool outputFiles); } diff --git a/flow/flow_ebos_oilwater.cpp b/flow/flow_ebos_oilwater.cpp index fb0013750..c2d000379 100644 --- a/flow/flow_ebos_oilwater.cpp +++ b/flow/flow_ebos_oilwater.cpp @@ -60,13 +60,13 @@ public: }} namespace Opm { -void flowEbosOilWaterSetDeck(double setupTime, Deck &deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig) +void flowEbosOilWaterSetDeck(double setupTime, Deck *deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig) { typedef TTAG(EclFlowOilWaterProblem) TypeTag; typedef GET_PROP_TYPE(TypeTag, Vanguard) Vanguard; Vanguard::setExternalSetupTime(setupTime); - Vanguard::setExternalDeck(&deck); + Vanguard::setExternalDeck(deck); Vanguard::setExternalEclState(&eclState); Vanguard::setExternalSchedule(&schedule); Vanguard::setExternalSummaryConfig(&summaryConfig); diff --git a/flow/flow_ebos_oilwater.hpp b/flow/flow_ebos_oilwater.hpp index 0cf0fee6a..d93fd6782 100644 --- a/flow/flow_ebos_oilwater.hpp +++ b/flow/flow_ebos_oilwater.hpp @@ -23,7 +23,7 @@ #include namespace Opm { -void flowEbosOilWaterSetDeck(double setupTime, Deck &deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig); +void flowEbosOilWaterSetDeck(double setupTime, Deck *deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig); int flowEbosOilWaterMain(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 19537a3a7..104af11fc 100644 --- a/flow/flow_ebos_oilwater_polymer.cpp +++ b/flow/flow_ebos_oilwater_polymer.cpp @@ -61,13 +61,13 @@ public: }} namespace Opm { -void flowEbosOilWaterPolymerSetDeck(double setupTime, Deck& deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig) +void flowEbosOilWaterPolymerSetDeck(double setupTime, Deck* deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig) { typedef TTAG(EclFlowOilWaterPolymerProblem) TypeTag; typedef GET_PROP_TYPE(TypeTag, Vanguard) Vanguard; Vanguard::setExternalSetupTime(setupTime); - Vanguard::setExternalDeck(&deck); + Vanguard::setExternalDeck(deck); Vanguard::setExternalEclState(&eclState); Vanguard::setExternalSchedule(&schedule); Vanguard::setExternalSummaryConfig(&summaryConfig); diff --git a/flow/flow_ebos_oilwater_polymer.hpp b/flow/flow_ebos_oilwater_polymer.hpp index 4d759c57f..9190622e1 100644 --- a/flow/flow_ebos_oilwater_polymer.hpp +++ b/flow/flow_ebos_oilwater_polymer.hpp @@ -23,7 +23,7 @@ #include namespace Opm { -void flowEbosOilWaterPolymerSetDeck(double setupTime, Deck& deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig); +void flowEbosOilWaterPolymerSetDeck(double setupTime, Deck* deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig); int flowEbosOilWaterPolymerMain(int argc, char** argv, bool outputCout, bool outputFiles); } diff --git a/flow/flow_ebos_polymer.cpp b/flow/flow_ebos_polymer.cpp index 23357e288..f03448e77 100644 --- a/flow/flow_ebos_polymer.cpp +++ b/flow/flow_ebos_polymer.cpp @@ -36,13 +36,13 @@ SET_BOOL_PROP(EclFlowPolymerProblem, EnablePolymer, true); }} namespace Opm { -void flowEbosPolymerSetDeck(double setupTime, Deck &deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig) +void flowEbosPolymerSetDeck(double setupTime, Deck *deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig) { typedef TTAG(EclFlowPolymerProblem) TypeTag; typedef GET_PROP_TYPE(TypeTag, Vanguard) Vanguard; Vanguard::setExternalSetupTime(setupTime); - Vanguard::setExternalDeck(&deck); + Vanguard::setExternalDeck(deck); Vanguard::setExternalEclState(&eclState); Vanguard::setExternalSchedule(&schedule); Vanguard::setExternalSummaryConfig(&summaryConfig); diff --git a/flow/flow_ebos_polymer.hpp b/flow/flow_ebos_polymer.hpp index d278cfef5..4e5e755d9 100644 --- a/flow/flow_ebos_polymer.hpp +++ b/flow/flow_ebos_polymer.hpp @@ -23,7 +23,7 @@ #include namespace Opm { -void flowEbosPolymerSetDeck(double setupTime, Deck &deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig); +void flowEbosPolymerSetDeck(double setupTime, Deck *deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig); 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 5b720e9e0..0beb3c43a 100644 --- a/flow/flow_ebos_solvent.cpp +++ b/flow/flow_ebos_solvent.cpp @@ -36,13 +36,13 @@ SET_BOOL_PROP(EclFlowSolventProblem, EnableSolvent, true); }} namespace Opm { -void flowEbosSolventSetDeck(double setupTime, Deck &deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig) +void flowEbosSolventSetDeck(double setupTime, Deck *deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig) { typedef TTAG(EclFlowSolventProblem) TypeTag; typedef GET_PROP_TYPE(TypeTag, Vanguard) Vanguard; Vanguard::setExternalSetupTime(setupTime); - Vanguard::setExternalDeck(&deck); + Vanguard::setExternalDeck(deck); Vanguard::setExternalEclState(&eclState); Vanguard::setExternalSchedule(&schedule); Vanguard::setExternalSummaryConfig(&summaryConfig); diff --git a/flow/flow_ebos_solvent.hpp b/flow/flow_ebos_solvent.hpp index b9e4b2aff..95f24e7e4 100644 --- a/flow/flow_ebos_solvent.hpp +++ b/flow/flow_ebos_solvent.hpp @@ -24,7 +24,7 @@ namespace Opm { -void flowEbosSolventSetDeck(double setupTime, Deck &deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig); +void flowEbosSolventSetDeck(double setupTime, Deck *deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig); int flowEbosSolventMain(int argc, char** argv, bool outoutCout, bool outputFiles); }