changed: pass/store deck as a pointer

and remove asserts for null-ptr. preparatory step for only
having deck on root mpi process
This commit is contained in:
Arne Morten Kvarving
2020-01-22 10:17:02 +01:00
parent 35de9fa53d
commit 68a9d17de1
20 changed files with 36 additions and 38 deletions

View File

@@ -322,7 +322,6 @@ public:
Opm::checkDeck(*deck_, parser, *parseContext_, *errorGuard_); Opm::checkDeck(*deck_, parser, *parseContext_, *errorGuard_);
} }
else { else {
assert(externalDeck_);
deck_ = externalDeck_; deck_ = externalDeck_;
} }
@@ -331,7 +330,6 @@ public:
eclState_ = internalEclState_.get(); eclState_ = internalEclState_.get();
} }
else { else {
assert(externalDeck_);
assert(externalEclState_); assert(externalEclState_);
deck_ = externalDeck_; deck_ = externalDeck_;

View File

@@ -410,13 +410,13 @@ int main(int argc, char** argv)
// oil-gas // oil-gas
if (phases.active( Opm::Phase::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); return Opm::flowEbosGasOilMain(argc, argv, outputCout, outputFiles);
} }
// oil-water // oil-water
else if ( phases.active( Opm::Phase::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); return Opm::flowEbosOilWaterMain(argc, argv, outputCout, outputFiles);
} }
else { else {
@@ -444,37 +444,37 @@ int main(int argc, char** argv)
} }
if ( phases.size() == 3 ) { // oil water polymer case 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); return Opm::flowEbosOilWaterPolymerMain(argc, argv, outputCout, outputFiles);
} else { } 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); return Opm::flowEbosPolymerMain(argc, argv, outputCout, outputFiles);
} }
} }
// Foam case // Foam case
else if ( phases.active( Opm::Phase::FOAM ) ) { 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); return Opm::flowEbosFoamMain(argc, argv, outputCout, outputFiles);
} }
// Brine case // Brine case
else if ( phases.active( Opm::Phase::BRINE ) ) { 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); return Opm::flowEbosBrineMain(argc, argv, outputCout, outputFiles);
} }
// Solvent case // Solvent case
else if ( phases.active( Opm::Phase::SOLVENT ) ) { 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); return Opm::flowEbosSolventMain(argc, argv, outputCout, outputFiles);
} }
// Energy case // Energy case
else if (eclipseState->getSimulationConfig().isThermal()) { 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); return Opm::flowEbosEnergyMain(argc, argv, outputCout, outputFiles);
} }
#endif // FLOW_BLACKOIL_ONLY #endif // FLOW_BLACKOIL_ONLY
// Blackoil case // Blackoil case
else if( phases.size() == 3 ) { 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); return Opm::flowEbosBlackoilMain(argc, argv, outputCout, outputFiles);
} }
else else

View File

@@ -34,13 +34,13 @@
namespace Opm { 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 TTAG(EclFlowProblem) TypeTag;
typedef GET_PROP_TYPE(TypeTag, Vanguard) Vanguard; typedef GET_PROP_TYPE(TypeTag, Vanguard) Vanguard;
Vanguard::setExternalSetupTime(setupTime); Vanguard::setExternalSetupTime(setupTime);
Vanguard::setExternalDeck(&deck); Vanguard::setExternalDeck(deck);
Vanguard::setExternalEclState(&eclState); Vanguard::setExternalEclState(&eclState);
Vanguard::setExternalSchedule(&schedule); Vanguard::setExternalSchedule(&schedule);
Vanguard::setExternalSummaryConfig(&summaryConfig); Vanguard::setExternalSummaryConfig(&summaryConfig);

View File

@@ -23,7 +23,7 @@
#include <opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp> #include <opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
namespace Opm { 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); int flowEbosBlackoilMain(int argc, char** argv, bool outputCout, bool outputFiles);
} }

View File

@@ -36,13 +36,13 @@ SET_BOOL_PROP(EclFlowBrineProblem, EnableBrine, true);
}} }}
namespace Opm { 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 TTAG(EclFlowBrineProblem) TypeTag;
typedef GET_PROP_TYPE(TypeTag, Vanguard) Vanguard; typedef GET_PROP_TYPE(TypeTag, Vanguard) Vanguard;
Vanguard::setExternalSetupTime(setupTime); Vanguard::setExternalSetupTime(setupTime);
Vanguard::setExternalDeck(&deck); Vanguard::setExternalDeck(deck);
Vanguard::setExternalEclState(&eclState); Vanguard::setExternalEclState(&eclState);
Vanguard::setExternalSchedule(&schedule); Vanguard::setExternalSchedule(&schedule);
Vanguard::setExternalSummaryConfig(&summaryConfig); Vanguard::setExternalSummaryConfig(&summaryConfig);

View File

@@ -24,7 +24,7 @@
namespace Opm { 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); int flowEbosBrineMain(int argc, char** argv, bool outputCout, bool outputFiles);
} }

View File

@@ -36,13 +36,13 @@ SET_BOOL_PROP(EclFlowEnergyProblem, EnableEnergy, true);
}} }}
namespace Opm { 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 TTAG(EclFlowEnergyProblem) TypeTag;
typedef GET_PROP_TYPE(TypeTag, Vanguard) Vanguard; typedef GET_PROP_TYPE(TypeTag, Vanguard) Vanguard;
Vanguard::setExternalSetupTime(setupTime); Vanguard::setExternalSetupTime(setupTime);
Vanguard::setExternalDeck(&deck); Vanguard::setExternalDeck(deck);
Vanguard::setExternalEclState(&eclState); Vanguard::setExternalEclState(&eclState);
Vanguard::setExternalSchedule(&schedule); Vanguard::setExternalSchedule(&schedule);
Vanguard::setExternalSummaryConfig(&summaryConfig); Vanguard::setExternalSummaryConfig(&summaryConfig);

View File

@@ -23,7 +23,7 @@
#include <opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp> #include <opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
namespace Opm { 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); int flowEbosEnergyMain(int argc, char** argv, bool outputCout, bool outputFiles);
} }

View File

@@ -36,13 +36,13 @@ SET_BOOL_PROP(EclFlowFoamProblem, EnableFoam, true);
}} }}
namespace Opm { 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 TTAG(EclFlowFoamProblem) TypeTag;
typedef GET_PROP_TYPE(TypeTag, Vanguard) Vanguard; typedef GET_PROP_TYPE(TypeTag, Vanguard) Vanguard;
Vanguard::setExternalSetupTime(setupTime); Vanguard::setExternalSetupTime(setupTime);
Vanguard::setExternalDeck(&deck); Vanguard::setExternalDeck(deck);
Vanguard::setExternalEclState(&eclState); Vanguard::setExternalEclState(&eclState);
Vanguard::setExternalSchedule(&schedule); Vanguard::setExternalSchedule(&schedule);
Vanguard::setExternalSummaryConfig(&summaryConfig); Vanguard::setExternalSummaryConfig(&summaryConfig);

View File

@@ -24,7 +24,7 @@
namespace Opm { 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); int flowEbosFoamMain(int argc, char** argv, bool outputCout, bool outputFiles);
} }

View File

@@ -60,13 +60,13 @@ public:
}} }}
namespace Opm { 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 TTAG(EclFlowGasOilProblem) TypeTag;
typedef GET_PROP_TYPE(TypeTag, Vanguard) Vanguard; typedef GET_PROP_TYPE(TypeTag, Vanguard) Vanguard;
Vanguard::setExternalSetupTime(setupTime); Vanguard::setExternalSetupTime(setupTime);
Vanguard::setExternalDeck(&deck); Vanguard::setExternalDeck(deck);
Vanguard::setExternalEclState(&eclState); Vanguard::setExternalEclState(&eclState);
Vanguard::setExternalSchedule(&schedule); Vanguard::setExternalSchedule(&schedule);
Vanguard::setExternalSummaryConfig(&summaryConfig); Vanguard::setExternalSummaryConfig(&summaryConfig);

View File

@@ -23,7 +23,7 @@
#include <opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp> #include <opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
namespace Opm { 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); int flowEbosGasOilMain(int argc, char** argv, bool outputCout, bool outputFiles);
} }

View File

@@ -60,13 +60,13 @@ public:
}} }}
namespace Opm { 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 TTAG(EclFlowOilWaterProblem) TypeTag;
typedef GET_PROP_TYPE(TypeTag, Vanguard) Vanguard; typedef GET_PROP_TYPE(TypeTag, Vanguard) Vanguard;
Vanguard::setExternalSetupTime(setupTime); Vanguard::setExternalSetupTime(setupTime);
Vanguard::setExternalDeck(&deck); Vanguard::setExternalDeck(deck);
Vanguard::setExternalEclState(&eclState); Vanguard::setExternalEclState(&eclState);
Vanguard::setExternalSchedule(&schedule); Vanguard::setExternalSchedule(&schedule);
Vanguard::setExternalSummaryConfig(&summaryConfig); Vanguard::setExternalSummaryConfig(&summaryConfig);

View File

@@ -23,7 +23,7 @@
#include <opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp> #include <opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
namespace Opm { 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); int flowEbosOilWaterMain(int argc, char** argv, bool outputCout, bool outputFiles);
} }

View File

@@ -61,13 +61,13 @@ public:
}} }}
namespace Opm { 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 TTAG(EclFlowOilWaterPolymerProblem) TypeTag;
typedef GET_PROP_TYPE(TypeTag, Vanguard) Vanguard; typedef GET_PROP_TYPE(TypeTag, Vanguard) Vanguard;
Vanguard::setExternalSetupTime(setupTime); Vanguard::setExternalSetupTime(setupTime);
Vanguard::setExternalDeck(&deck); Vanguard::setExternalDeck(deck);
Vanguard::setExternalEclState(&eclState); Vanguard::setExternalEclState(&eclState);
Vanguard::setExternalSchedule(&schedule); Vanguard::setExternalSchedule(&schedule);
Vanguard::setExternalSummaryConfig(&summaryConfig); Vanguard::setExternalSummaryConfig(&summaryConfig);

View File

@@ -23,7 +23,7 @@
#include <opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp> #include <opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
namespace Opm { 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); int flowEbosOilWaterPolymerMain(int argc, char** argv, bool outputCout, bool outputFiles);
} }

View File

@@ -36,13 +36,13 @@ SET_BOOL_PROP(EclFlowPolymerProblem, EnablePolymer, true);
}} }}
namespace Opm { 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 TTAG(EclFlowPolymerProblem) TypeTag;
typedef GET_PROP_TYPE(TypeTag, Vanguard) Vanguard; typedef GET_PROP_TYPE(TypeTag, Vanguard) Vanguard;
Vanguard::setExternalSetupTime(setupTime); Vanguard::setExternalSetupTime(setupTime);
Vanguard::setExternalDeck(&deck); Vanguard::setExternalDeck(deck);
Vanguard::setExternalEclState(&eclState); Vanguard::setExternalEclState(&eclState);
Vanguard::setExternalSchedule(&schedule); Vanguard::setExternalSchedule(&schedule);
Vanguard::setExternalSummaryConfig(&summaryConfig); Vanguard::setExternalSummaryConfig(&summaryConfig);

View File

@@ -23,7 +23,7 @@
#include <opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp> #include <opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
namespace Opm { 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); int flowEbosPolymerMain(int argc, char** argv, bool outputCout, bool outputFiles);
} }

View File

@@ -36,13 +36,13 @@ SET_BOOL_PROP(EclFlowSolventProblem, EnableSolvent, true);
}} }}
namespace Opm { 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 TTAG(EclFlowSolventProblem) TypeTag;
typedef GET_PROP_TYPE(TypeTag, Vanguard) Vanguard; typedef GET_PROP_TYPE(TypeTag, Vanguard) Vanguard;
Vanguard::setExternalSetupTime(setupTime); Vanguard::setExternalSetupTime(setupTime);
Vanguard::setExternalDeck(&deck); Vanguard::setExternalDeck(deck);
Vanguard::setExternalEclState(&eclState); Vanguard::setExternalEclState(&eclState);
Vanguard::setExternalSchedule(&schedule); Vanguard::setExternalSchedule(&schedule);
Vanguard::setExternalSummaryConfig(&summaryConfig); Vanguard::setExternalSummaryConfig(&summaryConfig);

View File

@@ -24,7 +24,7 @@
namespace Opm { 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); int flowEbosSolventMain(int argc, char** argv, bool outoutCout, bool outputFiles);
} }