Move to more consistent ownership of ECL data in EclBaseVanguard

We resort to consistently use unique_ptrs in EclBaseVanguard for
the data read from ECL files or set externally. This means that
during the simulation EclBaseVanguard owns this data and not Main
or the ebos setup functions. This ownership transfer becomes
transparent due to std::move.

This came up when trying to fix the parallel runs of ebos and during
that removing some code duplication.
This commit is contained in:
Markus Blatt 2020-08-17 21:15:46 +02:00
parent 83bfd4edfc
commit 75104fd310
41 changed files with 315 additions and 227 deletions

View File

@ -89,18 +89,18 @@ std::unique_ptr<Opm::ParseContext> ebosBlackOilCreateParseContext(int argc, char
return result;
}
void ebosBlackOilSetDeck(Opm::Deck* deck,
Opm::ParseContext* parseContext,
Opm::ErrorGuard* errorGuard,
void ebosBlackOilSetDeck(std::unique_ptr<Opm::Deck> deck,
std::unique_ptr<Opm::ParseContext> parseContext,
std::unique_ptr<Opm::ErrorGuard> errorGuard,
double externalSetupTime)
{
using ProblemTypeTag = Properties::TTag::EbosTypeTag;
using Vanguard = GetPropType<ProblemTypeTag, Properties::Vanguard>;
Vanguard::setExternalSetupTime(externalSetupTime);
Vanguard::setExternalParseContext(parseContext);
Vanguard::setExternalErrorGuard(errorGuard);
Vanguard::setExternalDeck(deck);
Vanguard::setExternalParseContext(std::move(parseContext));
Vanguard::setExternalErrorGuard(std::move(errorGuard));
Vanguard::setExternalDeck(std::move(deck));
}
int ebosBlackOilMain(int argc, char **argv)

View File

@ -40,9 +40,9 @@ bool ebosBlackOilDeckFileNameIsSet(int argc, char** argv);
std::string ebosBlackOilGetDeckFileName(int argc, char** argv);
std::unique_ptr<Opm::ParseContext> ebosBlackOilCreateParseContext(int argc, char** argv);
void ebosBlackOilSetDeck(Opm::Deck* deck,
Opm::ParseContext* parseContext,
Opm::ErrorGuard* errorGuard,
void ebosBlackOilSetDeck(std::unique_ptr<Opm::Deck> deck,
std::unique_ptr<Opm::ParseContext> parseContext,
std::unique_ptr<Opm::ErrorGuard> errorGuard,
double externalSetupTime);
int ebosBlackOilMain(int argc, char** argv);

View File

@ -41,18 +41,18 @@ SET_BOOL_PROP(EbosBrineTypeTag, EnableBrine, true);
namespace Opm {
void ebosBrineSetDeck(Opm::Deck* deck,
Opm::ParseContext* parseContext,
Opm::ErrorGuard* errorGuard,
double externalSetupTime)
void ebosBrineSetDeck(std::unique_ptr<Opm::Deck> deck,
std::unique_ptr<Opm::ParseContext> parseContext,
std::unique_ptr<Opm::ErrorGuard> errorGuard,
double externalSetupTime)
{
using ProblemTypeTag = Properties::TTag::EbosBrineTypeTag;
using Vanguard = GetPropType<ProblemTypeTag, Properties::Vanguard>;
Vanguard::setExternalSetupTime(externalSetupTime);
Vanguard::setExternalParseContext(parseContext);
Vanguard::setExternalErrorGuard(errorGuard);
Vanguard::setExternalDeck(deck);
Vanguard::setExternalParseContext(std::move(parseContext));
Vanguard::setExternalErrorGuard(std::move(errorGuard));
Vanguard::setExternalDeck(std::move(deck));
}
int ebosBrineMain(int argc, char **argv)

View File

@ -41,18 +41,18 @@ SET_BOOL_PROP(EbosFoamTypeTag, EnableFoam, true);
namespace Opm {
void ebosFoamSetDeck(Opm::Deck* deck,
Opm::ParseContext* parseContext,
Opm::ErrorGuard* errorGuard,
void ebosFoamSetDeck(std::unique_ptr<Opm::Deck> deck,
std::unique_ptr<Opm::ParseContext> parseContext,
std::unique_ptr<Opm::ErrorGuard> errorGuard,
double externalSetupTime)
{
using ProblemTypeTag = Properties::TTag::EbosFoamTypeTag;
using Vanguard = GetPropType<ProblemTypeTag, Properties::Vanguard>;
Vanguard::setExternalSetupTime(externalSetupTime);
Vanguard::setExternalParseContext(parseContext);
Vanguard::setExternalErrorGuard(errorGuard);
Vanguard::setExternalDeck(deck);
Vanguard::setExternalParseContext(std::move(parseContext));
Vanguard::setExternalErrorGuard(std::move(errorGuard));
Vanguard::setExternalDeck(std::move(deck));
}
int ebosFoamMain(int argc, char **argv)

View File

@ -33,9 +33,9 @@
#include <opm/parser/eclipse/Parser/ErrorGuard.hpp>
namespace Opm {
void ebosFoamSetDeck(Opm::Deck* deck,
Opm::ParseContext* parseContext,
Opm::ErrorGuard* errorGuard,
void ebosFoamSetDeck(std::unique_ptr<Opm::Deck> deck,
std::unique_ptr<Opm::ParseContext> parseContext,
std::unique_ptr<Opm::ErrorGuard> errorGuard,
double externalSetupTime);
int ebosFoamMain(int argc, char** argv);

View File

@ -57,18 +57,18 @@ public:
namespace Opm {
void ebosGasOilSetDeck(Opm::Deck* deck,
Opm::ParseContext* parseContext,
Opm::ErrorGuard* errorGuard,
void ebosGasOilSetDeck(std::unique_ptr<Opm::Deck> deck,
std::unique_ptr<Opm::ParseContext> parseContext,
std::unique_ptr<Opm::ErrorGuard> errorGuard,
double externalSetupTime)
{
using ProblemTypeTag = Properties::TTag::EbosGasOilTypeTag;
using Vanguard = GetPropType<ProblemTypeTag, Properties::Vanguard>;
Vanguard::setExternalSetupTime(externalSetupTime);
Vanguard::setExternalParseContext(parseContext);
Vanguard::setExternalErrorGuard(errorGuard);
Vanguard::setExternalDeck(deck);
Vanguard::setExternalParseContext(std::move(parseContext));
Vanguard::setExternalErrorGuard(std::move(errorGuard));
Vanguard::setExternalDeck(std::move(deck));
}
int ebosGasOilMain(int argc, char **argv)

View File

@ -33,9 +33,9 @@
#include <opm/parser/eclipse/Parser/ErrorGuard.hpp>
namespace Opm {
void ebosGasOilSetDeck(Opm::Deck* deck,
Opm::ParseContext* parseContext,
Opm::ErrorGuard* errorGuard,
void ebosGasOilSetDeck(std::unique_ptr<Opm::Deck> deck,
std::unique_ptr<Opm::ParseContext> parseContext,
std::unique_ptr<Opm::ErrorGuard> errorGuard,
double externalSetupTime);
int ebosGasOilMain(int argc, char** argv);

View File

@ -57,18 +57,18 @@ public:
namespace Opm {
void ebosOilWaterSetDeck(Opm::Deck* deck,
Opm::ParseContext* parseContext,
Opm::ErrorGuard* errorGuard,
void ebosOilWaterSetDeck(std::unique_ptr<Opm::Deck> deck,
std::unique_ptr<Opm::ParseContext> parseContext,
std::unique_ptr<Opm::ErrorGuard> errorGuard,
double externalSetupTime)
{
using ProblemTypeTag = Properties::TTag::EbosOilWaterTypeTag;
using Vanguard = GetPropType<ProblemTypeTag, Properties::Vanguard>;
Vanguard::setExternalSetupTime(externalSetupTime);
Vanguard::setExternalParseContext(parseContext);
Vanguard::setExternalErrorGuard(errorGuard);
Vanguard::setExternalDeck(deck);
Vanguard::setExternalParseContext(std::move(parseContext));
Vanguard::setExternalErrorGuard(std::move(errorGuard));
Vanguard::setExternalDeck(std::move(deck));
}
int ebosOilWaterMain(int argc, char **argv)

View File

@ -33,9 +33,9 @@
#include <opm/parser/eclipse/Parser/ErrorGuard.hpp>
namespace Opm {
void ebosOilWaterSetDeck(Opm::Deck* deck,
Opm::ParseContext* parseContext,
Opm::ErrorGuard* errorGuard,
void ebosOilWaterSetDeck(std::unique_ptr<Opm::Deck> deck,
std::unique_ptr<Opm::ParseContext> parseContext,
std::unique_ptr<Opm::ErrorGuard> errorGuard,
double externalSetupTime);
int ebosOilWaterMain(int argc, char** argv);

View File

@ -59,18 +59,18 @@ public:
namespace Opm {
void ebosOilWaterPolymerSetDeck(Opm::Deck* deck,
Opm::ParseContext* parseContext,
Opm::ErrorGuard* errorGuard,
void ebosOilWaterPolymerSetDeck(std::unique_ptr<Opm::Deck> deck,
std::unique_ptr<Opm::ParseContext> parseContext,
std::unique_ptr<Opm::ErrorGuard> errorGuard,
double externalSetupTime)
{
using ProblemTypeTag = Properties::TTag::EbosOilWaterPolymerTypeTag;
using Vanguard = GetPropType<ProblemTypeTag, Properties::Vanguard>;
Vanguard::setExternalSetupTime(externalSetupTime);
Vanguard::setExternalParseContext(parseContext);
Vanguard::setExternalErrorGuard(errorGuard);
Vanguard::setExternalDeck(deck);
Vanguard::setExternalParseContext(std::move(parseContext));
Vanguard::setExternalErrorGuard(std::move(errorGuard));
Vanguard::setExternalDeck(std::move(deck));
}
int ebosOilWaterPolymerMain(int argc, char **argv)

View File

@ -33,9 +33,9 @@
#include <opm/parser/eclipse/Parser/ErrorGuard.hpp>
namespace Opm {
void ebosOilWaterPolymerSetDeck(Opm::Deck* deck,
Opm::ParseContext* parseContext,
Opm::ErrorGuard* errorGuard,
void ebosOilWaterPolymerSetDeck(std::unique_ptr<Opm::Deck> deck,
std::unique_ptr<Opm::ParseContext> parseContext,
std::unique_ptr<Opm::ErrorGuard> errorGuard,
double externalSetupTime);
int ebosOilWaterPolymerMain(int argc, char** argv);

View File

@ -41,18 +41,18 @@ SET_BOOL_PROP(EbosPolymerTypeTag, EnablePolymer, true);
namespace Opm {
void ebosPolymerSetDeck(Opm::Deck* deck,
Opm::ParseContext* parseContext,
Opm::ErrorGuard* errorGuard,
void ebosPolymerSetDeck(std::unique_ptr<Opm::Deck> deck,
std::unique_ptr<Opm::ParseContext> parseContext,
std::unique_ptr<Opm::ErrorGuard> errorGuard,
double externalSetupTime)
{
using ProblemTypeTag = Properties::TTag::EbosPolymerTypeTag;
using Vanguard = GetPropType<ProblemTypeTag, Properties::Vanguard>;
Vanguard::setExternalSetupTime(externalSetupTime);
Vanguard::setExternalParseContext(parseContext);
Vanguard::setExternalErrorGuard(errorGuard);
Vanguard::setExternalDeck(deck);
Vanguard::setExternalParseContext(std::move(parseContext));
Vanguard::setExternalErrorGuard(std::move(errorGuard));
Vanguard::setExternalDeck(std::move(deck));
}
int ebosPolymerMain(int argc, char **argv)

View File

@ -33,9 +33,9 @@
#include <opm/parser/eclipse/Parser/ErrorGuard.hpp>
namespace Opm {
void ebosPolymerSetDeck(Opm::Deck* deck,
Opm::ParseContext* parseContext,
Opm::ErrorGuard* errorGuard,
void ebosPolymerSetDeck(std::unique_ptr<Opm::Deck> deck,
std::unique_ptr<Opm::ParseContext> parseContext,
std::unique_ptr<Opm::ErrorGuard> errorGuard,
double externalSetupTime);
int ebosPolymerMain(int argc, char** argv);

View File

@ -41,18 +41,18 @@ SET_BOOL_PROP(EbosSolventTypeTag, EnableSolvent, true);
namespace Opm {
void ebosSolventSetDeck(Opm::Deck* deck,
Opm::ParseContext* parseContext,
Opm::ErrorGuard* errorGuard,
void ebosSolventSetDeck(std::unique_ptr<Opm::Deck> deck,
std::unique_ptr<Opm::ParseContext> parseContext,
std::unique_ptr<Opm::ErrorGuard> errorGuard,
double externalSetupTime)
{
using ProblemTypeTag = Properties::TTag::EbosSolventTypeTag;
using Vanguard = GetPropType<ProblemTypeTag, Properties::Vanguard>;
Vanguard::setExternalSetupTime(externalSetupTime);
Vanguard::setExternalParseContext(parseContext);
Vanguard::setExternalErrorGuard(errorGuard);
Vanguard::setExternalDeck(deck);
Vanguard::setExternalParseContext(std::move(parseContext));
Vanguard::setExternalErrorGuard(std::move(errorGuard));
Vanguard::setExternalDeck(std::move(deck));
}
int ebosSolventMain(int argc, char **argv)

View File

@ -33,9 +33,9 @@
#include <opm/parser/eclipse/Parser/ErrorGuard.hpp>
namespace Opm {
void ebosSolventSetDeck(Opm::Deck* deck,
Opm::ParseContext* parseContext,
Opm::ErrorGuard* errorGuard,
void ebosSolventSetDeck(std::unique_ptr<Opm::Deck> deck,
std::unique_ptr<Opm::ParseContext> parseContext,
std::unique_ptr<Opm::ErrorGuard> errorGuard,
double externalSetupTime);
int ebosSolventMain(int argc, char** argv);

View File

@ -41,18 +41,18 @@ SET_BOOL_PROP(EbosThermalTypeTag, EnableEnergy, true);
namespace Opm {
void ebosThermalSetDeck(Opm::Deck* deck,
Opm::ParseContext* parseContext,
Opm::ErrorGuard* errorGuard,
void ebosThermalSetDeck(std::unique_ptr<Opm::Deck> deck,
std::unique_ptr<Opm::ParseContext> parseContext,
std::unique_ptr<Opm::ErrorGuard> errorGuard,
double externalSetupTime)
{
using ProblemTypeTag = Properties::TTag::EbosThermalTypeTag;
using Vanguard = GetPropType<ProblemTypeTag, Properties::Vanguard>;
Vanguard::setExternalSetupTime(externalSetupTime);
Vanguard::setExternalParseContext(parseContext);
Vanguard::setExternalErrorGuard(errorGuard);
Vanguard::setExternalDeck(deck);
Vanguard::setExternalParseContext(std::move(parseContext));
Vanguard::setExternalErrorGuard(std::move(errorGuard));
Vanguard::setExternalDeck(std::move(deck));
}
int ebosThermalMain(int argc, char **argv)

View File

@ -33,9 +33,9 @@
#include <opm/parser/eclipse/Parser/ErrorGuard.hpp>
namespace Opm {
void ebosThermalSetDeck(Opm::Deck* deck,
Opm::ParseContext* parseContext,
Opm::ErrorGuard* errorGuard,
void ebosThermalSetDeck(std::unique_ptr<Opm::Deck> deck,
std::unique_ptr<Opm::ParseContext> parseContext,
std::unique_ptr<Opm::ErrorGuard> errorGuard,
double externalSetupTime);
int ebosThermalMain(int argc, char** argv);

View File

@ -223,14 +223,14 @@ public:
/*!
* \brief Set the Opm::ParseContext object which ought to be used for parsing the deck and creating the Opm::EclipseState object.
*/
static void setExternalParseContext(Opm::ParseContext* parseContext)
{ externalParseContext_ = parseContext; }
static void setExternalParseContext(std::unique_ptr<Opm::ParseContext> parseContext)
{ externalParseContext_ = std::move(parseContext); }
/*!
* \brief Set the Opm::ErrorGuard object which ought to be used for parsing the deck and creating the Opm::EclipseState object.
*/
static void setExternalErrorGuard(Opm::ErrorGuard* errorGuard)
{ externalErrorGuard_ = errorGuard; }
static void setExternalErrorGuard(std::unique_ptr<Opm::ErrorGuard> errorGuard)
{ externalErrorGuard_ = std::move(errorGuard); }
/*!
* \brief Set the Opm::Deck object which ought to be used when the simulator vanguard
@ -242,14 +242,14 @@ public:
* management of these two objects, i.e., they are not allowed to be deleted as long
* as the simulator vanguard object is alive.
*/
static void setExternalDeck(Opm::Deck* deck)
{ externalDeck_ = deck; externalDeckSet_ = true; }
static void setExternalDeck(std::unique_ptr<Opm::Deck> deck)
{ externalDeck_ = std::move(deck); externalDeckSet_ = true; }
/*!
* \brief Set the Opm::EclipseState object which ought to be used when the simulator
* vanguard is instantiated.
*/
static void setExternalEclState(Opm::EclipseState* eclState)
{ externalEclState_ = eclState; }
static void setExternalEclState(std::unique_ptr<Opm::EclipseState> eclState)
{ externalEclState_ = std::move(eclState); }
/*!
* \brief Create the grid for problem data files which use the ECL file format.
@ -307,14 +307,14 @@ public:
parseContext_ = internalParseContext_.get();
}
else
parseContext_ = externalParseContext_;
parseContext_ = externalParseContext_.get();
if (!externalParseContext_) {
internalErrorGuard_.reset(new Opm::ErrorGuard);
errorGuard_ = internalErrorGuard_.get();
}
else
errorGuard_ = externalErrorGuard_;
errorGuard_ = externalErrorGuard_.get();
if (!externalDeck_ && !externalDeckSet_) {
if (myRank == 0)
@ -328,7 +328,7 @@ public:
Opm::checkDeck(*deck_, parser, *parseContext_, *errorGuard_);
}
else {
deck_ = externalDeck_;
deck_ = externalDeck_.get();
}
if (!externalEclState_) {
@ -338,8 +338,8 @@ public:
else {
assert(externalEclState_);
deck_ = externalDeck_;
eclState_ = externalEclState_;
deck_ = externalDeck_.get();
eclState_ = externalEclState_.get();
}
if (!externalEclSchedule_) {
@ -350,7 +350,7 @@ public:
eclSchedule_ = internalEclSchedule_.get();
}
else
eclSchedule_ = externalEclSchedule_;
eclSchedule_ = externalEclSchedule_.get();
this->summaryState_.reset( new Opm::SummaryState( std::chrono::system_clock::from_time_t(this->eclSchedule_->getStartTime() )));
this->actionState_.reset( new Opm::Action::State() );
@ -367,7 +367,7 @@ public:
eclSummaryConfig_ = internalEclSummaryConfig_.get();
}
else
eclSummaryConfig_ = externalEclSummaryConfig_;
eclSummaryConfig_ = externalEclSummaryConfig_.get();
if (*errorGuard_) {
errorGuard_->dump();
@ -416,8 +416,8 @@ public:
* The lifetime of this object is not managed by the vanguard, i.e., the object must
* stay valid until after the vanguard gets destroyed.
*/
static void setExternalSchedule(Opm::Schedule* schedule)
{ externalEclSchedule_ = schedule; }
static void setExternalSchedule(std::unique_ptr<Opm::Schedule> schedule)
{ externalEclSchedule_ = std::move(schedule); }
/*!
* \brief Return a reference to the object that determines which quantities ought to
@ -432,8 +432,8 @@ public:
* The lifetime of this object is not managed by the vanguard, i.e., the object must
* stay valid until after the vanguard gets destroyed.
*/
static void setExternalSummaryConfig(Opm::SummaryConfig* summaryConfig)
{ externalEclSummaryConfig_ = summaryConfig; }
static void setExternalSummaryConfig(std::unique_ptr<Opm::SummaryConfig> summaryConfig)
{ externalEclSummaryConfig_ = std::move(summaryConfig); }
/*!
@ -616,13 +616,13 @@ private:
static Scalar externalSetupTime_;
static Opm::ParseContext* externalParseContext_;
static Opm::ErrorGuard* externalErrorGuard_;
static Opm::Deck* externalDeck_;
static std::unique_ptr<Opm::ParseContext> externalParseContext_;
static std::unique_ptr<Opm::ErrorGuard> externalErrorGuard_;
static std::unique_ptr<Opm::Deck> externalDeck_;
static bool externalDeckSet_;
static Opm::EclipseState* externalEclState_;
static Opm::Schedule* externalEclSchedule_;
static Opm::SummaryConfig* externalEclSummaryConfig_;
static std::unique_ptr<Opm::EclipseState> externalEclState_;
static std::unique_ptr<Opm::Schedule> externalEclSchedule_;
static std::unique_ptr<Opm::SummaryConfig> externalEclSummaryConfig_;
std::unique_ptr<Opm::ParseContext> internalParseContext_;
std::unique_ptr<Opm::ErrorGuard> internalErrorGuard_;
@ -657,25 +657,25 @@ template <class TypeTag>
typename EclBaseVanguard<TypeTag>::Scalar EclBaseVanguard<TypeTag>::externalSetupTime_ = 0.0;
template <class TypeTag>
Opm::ParseContext* EclBaseVanguard<TypeTag>::externalParseContext_ = nullptr;
std::unique_ptr<Opm::ParseContext> EclBaseVanguard<TypeTag>::externalParseContext_ = nullptr;
template <class TypeTag>
Opm::ErrorGuard* EclBaseVanguard<TypeTag>::externalErrorGuard_ = nullptr;
std::unique_ptr<Opm::ErrorGuard> EclBaseVanguard<TypeTag>::externalErrorGuard_ = nullptr;
template <class TypeTag>
Opm::Deck* EclBaseVanguard<TypeTag>::externalDeck_ = nullptr;
std::unique_ptr<Opm::Deck> EclBaseVanguard<TypeTag>::externalDeck_ = nullptr;
template <class TypeTag>
bool EclBaseVanguard<TypeTag>::externalDeckSet_ = false;
template <class TypeTag>
Opm::EclipseState* EclBaseVanguard<TypeTag>::externalEclState_;
std::unique_ptr<Opm::EclipseState> EclBaseVanguard<TypeTag>::externalEclState_;
template <class TypeTag>
Opm::Schedule* EclBaseVanguard<TypeTag>::externalEclSchedule_ = nullptr;
std::unique_ptr<Opm::Schedule> EclBaseVanguard<TypeTag>::externalEclSchedule_ = nullptr;
template <class TypeTag>
Opm::SummaryConfig* EclBaseVanguard<TypeTag>::externalEclSummaryConfig_ = nullptr;
std::unique_ptr<Opm::SummaryConfig> EclBaseVanguard<TypeTag>::externalEclSummaryConfig_ = nullptr;
} // namespace Opm

View File

@ -123,9 +123,9 @@ int main(int argc, char **argv)
if (polymerActive && oilActive && waterActive) {
if (myRank == 0)
std::cout << "Using oil-water-polymer mode" << std::endl;
Opm::ebosOilWaterPolymerSetDeck(deck.get(),
parseContext.get(),
errorGuard.get(),
Opm::ebosOilWaterPolymerSetDeck(std::move(deck),
std::move(parseContext),
std::move(errorGuard),
externalSetupTimer.elapsed());
return Opm::ebosOilWaterPolymerMain(argc, argv);
}
@ -154,9 +154,9 @@ int main(int argc, char **argv)
if (oilActive && waterActive) {
if (myRank == 0)
std::cout << "Using oil-water mode" << std::endl;
Opm::ebosOilWaterSetDeck(deck.get(),
parseContext.get(),
errorGuard.get(),
Opm::ebosOilWaterSetDeck(std::move(deck),
std::move(parseContext),
std::move(errorGuard),
externalSetupTimer.elapsed());
return Opm::ebosOilWaterMain(argc, argv);
}
@ -164,9 +164,9 @@ int main(int argc, char **argv)
// run ebos_gasoil
if (myRank == 0)
std::cout << "Using gas-oil mode" << std::endl;
Opm::ebosGasOilSetDeck(deck.get(),
parseContext.get(),
errorGuard.get(),
Opm::ebosGasOilSetDeck(std::move(deck),
std::move(parseContext),
std::move(errorGuard),
externalSetupTimer.elapsed());
return Opm::ebosGasOilMain(argc, argv);
}
@ -202,9 +202,9 @@ int main(int argc, char **argv)
// run ebos_foam
if (myRank == 0)
std::cout << "Using foam mode" << std::endl;
Opm::ebosFoamSetDeck(deck.get(),
parseContext.get(),
errorGuard.get(),
Opm::ebosFoamSetDeck(std::move(deck),
std::move(parseContext),
std::move(errorGuard),
externalSetupTimer.elapsed());
return Opm::ebosFoamMain(argc, argv);
}
@ -233,9 +233,9 @@ int main(int argc, char **argv)
// run ebos_polymer
if (myRank == 0)
std::cout << "Using polymer mode" << std::endl;
Opm::ebosPolymerSetDeck(deck.get(),
parseContext.get(),
errorGuard.get(),
Opm::ebosPolymerSetDeck(std::move(deck),
std::move(parseContext),
std::move(errorGuard),
externalSetupTimer.elapsed());
return Opm::ebosPolymerMain(argc, argv);
}
@ -264,9 +264,9 @@ int main(int argc, char **argv)
// run ebos_solvent
if (myRank == 0)
std::cout << "Using solvent mode" << std::endl;
Opm::ebosSolventSetDeck(deck.get(),
parseContext.get(),
errorGuard.get(),
Opm::ebosSolventSetDeck(std::move(deck),
std::move(parseContext),
std::move(errorGuard),
externalSetupTimer.elapsed());
return Opm::ebosSolventMain(argc, argv);
}
@ -295,18 +295,18 @@ int main(int argc, char **argv)
// run ebos_thermal
if (myRank == 0)
std::cout << "Using thermal mode" << std::endl;
Opm::ebosThermalSetDeck(deck.get(),
parseContext.get(),
errorGuard.get(),
Opm::ebosThermalSetDeck(std::move(deck),
std::move(parseContext),
std::move(errorGuard),
externalSetupTimer.elapsed());
return Opm::ebosThermalMain(argc, argv);
}
else {
if (myRank == 0)
std::cout << "Using blackoil mode" << std::endl;
Opm::ebosBlackOilSetDeck(deck.get(),
parseContext.get(),
errorGuard.get(),
Opm::ebosBlackOilSetDeck(std::move(deck),
std::move(parseContext),
std::move(errorGuard),
externalSetupTimer.elapsed());
return Opm::ebosBlackOilMain(argc, argv);
}

View File

@ -34,16 +34,19 @@
namespace Opm {
void flowEbosBlackoilSetDeck(double setupTime, Deck *deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig)
void flowEbosBlackoilSetDeck(double setupTime, std::unique_ptr<Deck> deck,
std::unique_ptr<EclipseState> eclState,
std::unique_ptr<Schedule> schedule,
std::unique_ptr<SummaryConfig> summaryConfig)
{
using TypeTag = Properties::TTag::EclFlowProblem;
using Vanguard = GetPropType<TypeTag, Properties::Vanguard>;
Vanguard::setExternalSetupTime(setupTime);
Vanguard::setExternalDeck(deck);
Vanguard::setExternalEclState(&eclState);
Vanguard::setExternalSchedule(&schedule);
Vanguard::setExternalSummaryConfig(&summaryConfig);
Vanguard::setExternalDeck(std::move(deck));
Vanguard::setExternalEclState(std::move(eclState));
Vanguard::setExternalSchedule(std::move(schedule));
Vanguard::setExternalSummaryConfig(std::move(summaryConfig));
}
std::unique_ptr<Opm::FlowMainEbos<Properties::TTag::EclFlowProblem>>

View File

@ -24,7 +24,10 @@
#include <opm/simulators/flow/FlowMainEbos.hpp>
namespace Opm {
void flowEbosBlackoilSetDeck(double setupTime, Deck *deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig);
void flowEbosBlackoilSetDeck(double setupTime, std::unique_ptr<Deck> deck,
std::unique_ptr<EclipseState> eclState,
std::unique_ptr<Schedule> schedule,
std::unique_ptr<SummaryConfig> summaryConfig);
int flowEbosBlackoilMain(int argc, char** argv, bool outputCout, bool outputFiles);

View File

@ -36,16 +36,19 @@ SET_BOOL_PROP(EclFlowBrineProblem, EnableBrine, true);
}}
namespace Opm {
void flowEbosBrineSetDeck(double setupTime, Deck *deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig)
void flowEbosBrineSetDeck(double setupTime, std::unique_ptr<Deck> deck,
std::unique_ptr<EclipseState> eclState,
std::unique_ptr<Schedule> schedule,
std::unique_ptr<SummaryConfig> summaryConfig)
{
using TypeTag = Properties::TTag::EclFlowBrineProblem;
using Vanguard = GetPropType<TypeTag, Properties::Vanguard>;
Vanguard::setExternalSetupTime(setupTime);
Vanguard::setExternalDeck(deck);
Vanguard::setExternalEclState(&eclState);
Vanguard::setExternalSchedule(&schedule);
Vanguard::setExternalSummaryConfig(&summaryConfig);
Vanguard::setExternalDeck(std::move(deck));
Vanguard::setExternalEclState(std::move(eclState));
Vanguard::setExternalSchedule(std::move(schedule));
Vanguard::setExternalSummaryConfig(std::move(summaryConfig));
}

View File

@ -24,7 +24,10 @@
namespace Opm {
void flowEbosBrineSetDeck(double setupTime, Deck *deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig);
void flowEbosBrineSetDeck(double setupTime, std::unique_ptr<Deck> deck,
std::unique_ptr<EclipseState> eclState,
std::unique_ptr<Schedule> schedule,
std::unique_ptr<SummaryConfig> summaryConfig);
int flowEbosBrineMain(int argc, char** argv, bool outputCout, bool outputFiles);
}

View File

@ -36,16 +36,19 @@ SET_BOOL_PROP(EclFlowEnergyProblem, EnableEnergy, true);
}}
namespace Opm {
void flowEbosEnergySetDeck(double setupTime, Deck *deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig)
void flowEbosEnergySetDeck(double setupTime, std::unique_ptr<Deck> deck,
std::unique_ptr<EclipseState> eclState,
std::unique_ptr<Schedule> schedule,
std::unique_ptr<SummaryConfig> summaryConfig)
{
using TypeTag = Properties::TTag::EclFlowEnergyProblem;
using Vanguard = GetPropType<TypeTag, Properties::Vanguard>;
Vanguard::setExternalSetupTime(setupTime);
Vanguard::setExternalDeck(deck);
Vanguard::setExternalEclState(&eclState);
Vanguard::setExternalSchedule(&schedule);
Vanguard::setExternalSummaryConfig(&summaryConfig);
Vanguard::setExternalDeck(std::move(deck));
Vanguard::setExternalEclState(std::move(eclState));
Vanguard::setExternalSchedule(std::move(schedule));
Vanguard::setExternalSummaryConfig(std::move(summaryConfig));
}
// ----------------- Main program -----------------

View File

@ -23,7 +23,10 @@
#include <opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
namespace Opm {
void flowEbosEnergySetDeck(double setupTime, Deck *deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig);
void flowEbosEnergySetDeck(double setupTime, std::unique_ptr<Deck> deck,
std::unique_ptr<EclipseState> eclState,
std::unique_ptr<Schedule> schedule,
std::unique_ptr<SummaryConfig> summaryConfig);
int flowEbosEnergyMain(int argc, char** argv, bool outputCout, bool outputFiles);
}

View File

@ -36,16 +36,19 @@ SET_BOOL_PROP(EclFlowFoamProblem, EnableFoam, true);
}}
namespace Opm {
void flowEbosFoamSetDeck(double setupTime, Deck *deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig)
void flowEbosFoamSetDeck(double setupTime, std::unique_ptr<Deck> deck,
std::unique_ptr<EclipseState> eclState,
std::unique_ptr<Schedule> schedule,
std::unique_ptr<SummaryConfig> summaryConfig)
{
using TypeTag = Properties::TTag::EclFlowFoamProblem;
using Vanguard = GetPropType<TypeTag, Properties::Vanguard>;
Vanguard::setExternalSetupTime(setupTime);
Vanguard::setExternalDeck(deck);
Vanguard::setExternalEclState(&eclState);
Vanguard::setExternalSchedule(&schedule);
Vanguard::setExternalSummaryConfig(&summaryConfig);
Vanguard::setExternalDeck(std::move(deck));
Vanguard::setExternalEclState(std::move(eclState));
Vanguard::setExternalSchedule(std::move(schedule));
Vanguard::setExternalSummaryConfig(std::move(summaryConfig));
}

View File

@ -24,7 +24,10 @@
namespace Opm {
void flowEbosFoamSetDeck(double setupTime, Deck *deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig);
void flowEbosFoamSetDeck(double setupTime, std::unique_ptr<Deck> deck,
std::unique_ptr<EclipseState> eclState,
std::unique_ptr<Schedule> schedule,
std::unique_ptr<SummaryConfig> summaryConfig);
int flowEbosFoamMain(int argc, char** argv, bool outputCout, bool outputFiles);
}

View File

@ -60,16 +60,19 @@ public:
}}
namespace Opm {
void flowEbosGasOilSetDeck(double setupTime, Deck *deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig)
void flowEbosGasOilSetDeck(double setupTime, std::unique_ptr<Deck> deck,
std::unique_ptr<EclipseState> eclState,
std::unique_ptr<Schedule> schedule,
std::unique_ptr<SummaryConfig> summaryConfig)
{
using TypeTag = Properties::TTag::EclFlowGasOilProblem;
using Vanguard = GetPropType<TypeTag, Properties::Vanguard>;
Vanguard::setExternalSetupTime(setupTime);
Vanguard::setExternalDeck(deck);
Vanguard::setExternalEclState(&eclState);
Vanguard::setExternalSchedule(&schedule);
Vanguard::setExternalSummaryConfig(&summaryConfig);
Vanguard::setExternalDeck(std::move(deck));
Vanguard::setExternalEclState(std::move(eclState));
Vanguard::setExternalSchedule(std::move(schedule));
Vanguard::setExternalSummaryConfig(std::move(summaryConfig));
}

View File

@ -23,7 +23,10 @@
#include <opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
namespace Opm {
void flowEbosGasOilSetDeck(double setupTime, Deck *deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig);
void flowEbosGasOilSetDeck(double setupTime, std::unique_ptr<Deck> deck,
std::unique_ptr<EclipseState> eclState,
std::unique_ptr<Schedule> schedule,
std::unique_ptr<SummaryConfig> summaryConfig);
int flowEbosGasOilMain(int argc, char** argv, bool outputCout, bool outputFiles);
}

View File

@ -60,16 +60,19 @@ public:
}}
namespace Opm {
void flowEbosOilWaterSetDeck(double setupTime, Deck *deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig)
void flowEbosOilWaterSetDeck(double setupTime, std::unique_ptr<Deck> deck,
std::unique_ptr<EclipseState> eclState,
std::unique_ptr<Schedule> schedule,
std::unique_ptr<SummaryConfig> summaryConfig)
{
using TypeTag = Properties::TTag::EclFlowOilWaterProblem;
using Vanguard = GetPropType<TypeTag, Properties::Vanguard>;
Vanguard::setExternalSetupTime(setupTime);
Vanguard::setExternalDeck(deck);
Vanguard::setExternalEclState(&eclState);
Vanguard::setExternalSchedule(&schedule);
Vanguard::setExternalSummaryConfig(&summaryConfig);
Vanguard::setExternalDeck(std::move(deck));
Vanguard::setExternalEclState(std::move(eclState));
Vanguard::setExternalSchedule(std::move(schedule));
Vanguard::setExternalSummaryConfig(std::move(summaryConfig));
}
// ----------------- Main program -----------------

View File

@ -23,7 +23,10 @@
#include <opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
namespace Opm {
void flowEbosOilWaterSetDeck(double setupTime, Deck *deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig);
void flowEbosOilWaterSetDeck(double setupTime, std::unique_ptr<Deck> deck,
std::unique_ptr<EclipseState> eclState,
std::unique_ptr<Schedule> schedule,
std::unique_ptr<SummaryConfig> summaryConfig);
int flowEbosOilWaterMain(int argc, char** argv, bool outputCout, bool outputFiles);
}

View File

@ -60,16 +60,19 @@ public:
}}
namespace Opm {
void flowEbosOilWaterBrineSetDeck(double setupTime, Deck* deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig)
void flowEbosOilWaterBrineSetDeck(double setupTime, std::unique_ptr<Deck> deck,
std::unique_ptr<EclipseState> eclState,
std::unique_ptr<Schedule> schedule,
std::unique_ptr<SummaryConfig> summaryConfig)
{
using TypeTag = Properties::TTag::EclFlowOilWaterBrineProblem;
using Vanguard = GetPropType<TypeTag, Properties::Vanguard>;
Vanguard::setExternalSetupTime(setupTime);
Vanguard::setExternalDeck(deck);
Vanguard::setExternalEclState(&eclState);
Vanguard::setExternalSchedule(&schedule);
Vanguard::setExternalSummaryConfig(&summaryConfig);
Vanguard::setExternalDeck(std::move(deck));
Vanguard::setExternalEclState(std::move(eclState));
Vanguard::setExternalSchedule(std::move(schedule));
Vanguard::setExternalSummaryConfig(std::move(summaryConfig));
}
// ----------------- Main program -----------------

View File

@ -23,7 +23,10 @@
#include <opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
namespace Opm {
void flowEbosOilWaterBrineSetDeck(double setupTime, Deck* deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig);
void flowEbosOilWaterBrineSetDeck(double setupTime, std::unique_ptr<Deck> deck,
std::unique_ptr<EclipseState> eclState,
std::unique_ptr<Schedule> schedule,
std::unique_ptr<SummaryConfig> summaryConfig);
int flowEbosOilWaterBrineMain(int argc, char** argv, bool outputCout, bool outputFiles);
}

View File

@ -61,16 +61,19 @@ public:
}}
namespace Opm {
void flowEbosOilWaterPolymerSetDeck(double setupTime, Deck* deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig)
void flowEbosOilWaterPolymerSetDeck(double setupTime, std::unique_ptr<Deck> deck,
std::unique_ptr<EclipseState> eclState,
std::unique_ptr<Schedule> schedule,
std::unique_ptr<SummaryConfig> summaryConfig)
{
using TypeTag = Properties::TTag::EclFlowOilWaterPolymerProblem;
using Vanguard = GetPropType<TypeTag, Properties::Vanguard>;
Vanguard::setExternalSetupTime(setupTime);
Vanguard::setExternalDeck(deck);
Vanguard::setExternalEclState(&eclState);
Vanguard::setExternalSchedule(&schedule);
Vanguard::setExternalSummaryConfig(&summaryConfig);
Vanguard::setExternalDeck(std::move(deck));
Vanguard::setExternalEclState(std::move(eclState));
Vanguard::setExternalSchedule(std::move(schedule));
Vanguard::setExternalSummaryConfig(std::move(summaryConfig));
}
// ----------------- Main program -----------------

View File

@ -23,7 +23,10 @@
#include <opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
namespace Opm {
void flowEbosOilWaterPolymerSetDeck(double setupTime, Deck* deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig);
void flowEbosOilWaterPolymerSetDeck(double setupTime, std::unique_ptr<Deck> deck,
std::unique_ptr<EclipseState> eclState,
std::unique_ptr<Schedule> schedule,
std::unique_ptr<SummaryConfig> summaryConfig);
int flowEbosOilWaterPolymerMain(int argc, char** argv, bool outputCout, bool outputFiles);
}

View File

@ -68,7 +68,7 @@ namespace Opm {
using TypeTag = Properties::TTag::EclFlowOilWaterPolymerInjectivityProblem;
using Vanguard = GetPropType<TypeTag, Properties::Vanguard>;
Vanguard::setExternalDeck(&deck, &eclState);
Vanguard::setExternalDeck(std::move(deck, &eclState));
} */
// ----------------- Main program -----------------

View File

@ -36,16 +36,19 @@ SET_BOOL_PROP(EclFlowPolymerProblem, EnablePolymer, true);
}}
namespace Opm {
void flowEbosPolymerSetDeck(double setupTime, Deck *deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig)
void flowEbosPolymerSetDeck(double setupTime, std::unique_ptr<Deck> deck,
std::unique_ptr<EclipseState> eclState,
std::unique_ptr<Schedule> schedule,
std::unique_ptr<SummaryConfig> summaryConfig)
{
using TypeTag = Properties::TTag::EclFlowPolymerProblem;
using Vanguard = GetPropType<TypeTag, Properties::Vanguard>;
Vanguard::setExternalSetupTime(setupTime);
Vanguard::setExternalDeck(deck);
Vanguard::setExternalEclState(&eclState);
Vanguard::setExternalSchedule(&schedule);
Vanguard::setExternalSummaryConfig(&summaryConfig);
Vanguard::setExternalDeck(std::move(deck));
Vanguard::setExternalEclState(std::move(eclState));
Vanguard::setExternalSchedule(std::move(schedule));
Vanguard::setExternalSummaryConfig(std::move(summaryConfig));
}
// ----------------- Main program -----------------

View File

@ -23,7 +23,10 @@
#include <opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
namespace Opm {
void flowEbosPolymerSetDeck(double setupTime, Deck *deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig);
void flowEbosPolymerSetDeck(double setupTime, std::unique_ptr<Deck> deck,
std::unique_ptr<EclipseState> eclState,
std::unique_ptr<Schedule> schedule,
std::unique_ptr<SummaryConfig> summaryConfig);
int flowEbosPolymerMain(int argc, char** argv, bool outputCout, bool outputFiles);
}

View File

@ -36,16 +36,19 @@ SET_BOOL_PROP(EclFlowSolventProblem, EnableSolvent, true);
}}
namespace Opm {
void flowEbosSolventSetDeck(double setupTime, Deck *deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig)
void flowEbosSolventSetDeck(double setupTime, std::unique_ptr<Deck> deck,
std::unique_ptr<EclipseState> eclState,
std::unique_ptr<Schedule> schedule,
std::unique_ptr<SummaryConfig> summaryConfig)
{
using TypeTag = Properties::TTag::EclFlowSolventProblem;
using Vanguard = GetPropType<TypeTag, Properties::Vanguard>;
Vanguard::setExternalSetupTime(setupTime);
Vanguard::setExternalDeck(deck);
Vanguard::setExternalEclState(&eclState);
Vanguard::setExternalSchedule(&schedule);
Vanguard::setExternalSummaryConfig(&summaryConfig);
Vanguard::setExternalDeck(std::move(deck));
Vanguard::setExternalEclState(std::move(eclState));
Vanguard::setExternalSchedule(std::move(schedule));
Vanguard::setExternalSummaryConfig(std::move(summaryConfig));
}

View File

@ -24,7 +24,10 @@
namespace Opm {
void flowEbosSolventSetDeck(double setupTime, Deck *deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig);
void flowEbosSolventSetDeck(double setupTime, std::unique_ptr<Deck> deck,
std::unique_ptr<EclipseState> eclState,
std::unique_ptr<Schedule> schedule,
std::unique_ptr<SummaryConfig> summaryConfig);
int flowEbosSolventMain(int argc, char** argv, bool outoutCout, bool outputFiles);
}

View File

@ -78,13 +78,13 @@ NEW_TYPE_TAG(FlowEarlyBird, INHERITS_FROM(EclFlowProblem));
namespace Opm {
template <class TypeTag>
void flowEbosSetDeck(Deck *deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig)
void flowEbosSetDeck(std::unique_ptr<Deck> deck, std::unique_ptr<EclipseState> eclState, std::unique_ptr<Schedule> schedule, std::unique_ptr<SummaryConfig> summaryConfig)
{
using Vanguard = GetPropType<TypeTag, Properties::Vanguard>;
Vanguard::setExternalDeck(deck);
Vanguard::setExternalEclState(&eclState);
Vanguard::setExternalSchedule(&schedule);
Vanguard::setExternalSummaryConfig(&summaryConfig);
Vanguard::setExternalDeck(std::move(deck));
Vanguard::setExternalEclState(std::move(eclState));
Vanguard::setExternalSchedule(std::move(schedule));
Vanguard::setExternalSummaryConfig(std::move(summaryConfig));
}
// ----------------- Main program -----------------
@ -143,16 +143,16 @@ namespace Opm
Main(int argc,
char** argv,
std::shared_ptr<Opm::Deck> deck,
std::shared_ptr<Opm::EclipseState> eclipseState,
std::shared_ptr<Opm::Schedule> schedule,
std::shared_ptr<Opm::SummaryConfig> summaryConfig)
std::unique_ptr<Opm::Deck> deck,
std::unique_ptr<Opm::EclipseState> eclipseState,
std::unique_ptr<Opm::Schedule> schedule,
std::unique_ptr<Opm::SummaryConfig> summaryConfig)
: argc_(argc)
, argv_(argv)
, deck_(deck)
, eclipseState_(eclipseState)
, schedule_(schedule)
, summaryConfig_(summaryConfig)
, deck_(std::move(deck))
, eclipseState_(std::move(eclipseState))
, schedule_(std::move(schedule))
, summaryConfig_(std::move(summaryConfig))
{
}
@ -189,10 +189,10 @@ namespace Opm
// case. E.g. check that number of phases == 3
Opm::flowEbosBlackoilSetDeck(
setupTime_,
deck_.get(),
*eclipseState_,
*schedule_,
*summaryConfig_);
std::move(deck_),
std::move(eclipseState_),
std::move(schedule_),
std::move(summaryConfig_));
return Opm::flowEbosBlackoilMainInit(
argc_, argv_, outputCout_, outputFiles_);
} else {
@ -216,12 +216,13 @@ namespace Opm
else if( phases.size() == 2 ) {
// oil-gas
if (phases.active( Opm::Phase::GAS )) {
Opm::flowEbosGasOilSetDeck(setupTime_, deck_.get(), *eclipseState_, *schedule_, *summaryConfig_);
Opm::flowEbosGasOilSetDeck(setupTime_, std::move(deck_), std::move(eclipseState_),
std::move(schedule_), std::move(summaryConfig_));
return Opm::flowEbosGasOilMain(argc_, argv_, outputCout_, outputFiles_);
}
// oil-water
else if ( phases.active( Opm::Phase::WATER ) ) {
Opm::flowEbosOilWaterSetDeck(setupTime_, deck_.get(), *eclipseState_, *schedule_, *summaryConfig_);
Opm::flowEbosOilWaterSetDeck(setupTime_, std::move(deck_), std::move(eclipseState_), std::move(schedule_), std::move(summaryConfig_));
return Opm::flowEbosOilWaterMain(argc_, argv_, outputCout_, outputFiles_);
}
else {
@ -248,16 +249,25 @@ namespace Opm
}
if ( phases.size() == 3 ) { // oil water polymer case
Opm::flowEbosOilWaterPolymerSetDeck(setupTime_, deck_.get(), *eclipseState_, *schedule_, *summaryConfig_);
Opm::flowEbosOilWaterPolymerSetDeck(setupTime_, std::move(deck_),
std::move(eclipseState_),
std::move(schedule_),
std::move(summaryConfig_));
return Opm::flowEbosOilWaterPolymerMain(argc_, argv_, outputCout_, outputFiles_);
} else {
Opm::flowEbosPolymerSetDeck(setupTime_, deck_.get(), *eclipseState_, *schedule_, *summaryConfig_);
Opm::flowEbosPolymerSetDeck(setupTime_, std::move(deck_),
std::move(eclipseState_),
std::move(schedule_),
std::move(summaryConfig_));
return Opm::flowEbosPolymerMain(argc_, argv_, outputCout_, outputFiles_);
}
}
// Foam case
else if ( phases.active( Opm::Phase::FOAM ) ) {
Opm::flowEbosFoamSetDeck(setupTime_, deck_.get(), *eclipseState_, *schedule_, *summaryConfig_);
Opm::flowEbosFoamSetDeck(setupTime_, std::move(deck_),
std::move(eclipseState_),
std::move(schedule_),
std::move(summaryConfig_));
return Opm::flowEbosFoamMain(argc_, argv_, outputCout_, outputFiles_);
}
// Brine case
@ -269,27 +279,42 @@ namespace Opm
return EXIT_FAILURE;
}
if ( phases.size() == 3 ) { // oil water brine case
Opm::flowEbosOilWaterBrineSetDeck(setupTime_, deck_.get(), *eclipseState_, *schedule_, *summaryConfig_);
Opm::flowEbosOilWaterBrineSetDeck(setupTime_, std::move(deck_),
std::move(eclipseState_),
std::move(schedule_),
std::move(summaryConfig_));
return Opm::flowEbosOilWaterBrineMain(argc_, argv_, outputCout_, outputFiles_);
} else {
Opm::flowEbosBrineSetDeck(setupTime_, deck_.get(), *eclipseState_, *schedule_, *summaryConfig_);
Opm::flowEbosBrineSetDeck(setupTime_, std::move(deck_),
std::move(eclipseState_),
std::move(schedule_),
std::move(summaryConfig_));
return Opm::flowEbosBrineMain(argc_, argv_, outputCout_, outputFiles_);
}
}
// Solvent case
else if ( phases.active( Opm::Phase::SOLVENT ) ) {
Opm::flowEbosSolventSetDeck(setupTime_, deck_.get(), *eclipseState_, *schedule_, *summaryConfig_);
Opm::flowEbosSolventSetDeck(setupTime_, std::move(deck_),
std::move(eclipseState_),
std::move(schedule_),
std::move(summaryConfig_));
return Opm::flowEbosSolventMain(argc_, argv_, outputCout_, outputFiles_);
}
// Energy case
else if (eclipseState_->getSimulationConfig().isThermal()) {
Opm::flowEbosEnergySetDeck(setupTime_, deck_.get(), *eclipseState_, *schedule_, *summaryConfig_);
Opm::flowEbosEnergySetDeck(setupTime_, std::move(deck_),
std::move(eclipseState_),
std::move(schedule_),
std::move(summaryConfig_));
return Opm::flowEbosEnergyMain(argc_, argv_, outputCout_, outputFiles_);
}
#endif // FLOW_BLACKOIL_ONLY
// Blackoil case
else if( phases.size() == 3 ) {
Opm::flowEbosBlackoilSetDeck(setupTime_, deck_.get(), *eclipseState_, *schedule_, *summaryConfig_);
Opm::flowEbosBlackoilSetDeck(setupTime_, std::move(deck_),
std::move(eclipseState_),
std::move(schedule_),
std::move(summaryConfig_));
return Opm::flowEbosBlackoilMain(argc_, argv_, outputCout_, outputFiles_);
}
else {
@ -302,7 +327,10 @@ namespace Opm
template <class TypeTag>
int dispatchStatic_()
{
Opm::flowEbosSetDeck<TypeTag>(deck_.get(), *eclipseState_, *schedule_, *summaryConfig_);
Opm::flowEbosSetDeck<TypeTag>(std::move(deck_),
std::move(eclipseState_),
std::move(schedule_),
std::move(summaryConfig_));
return Opm::flowEbosMain<TypeTag>(argc_, argv_, outputCout_, outputFiles_);
}
@ -693,10 +721,10 @@ namespace Opm
std::string deckFilename_;
std::string flowProgName_;
char *saveArgs_[2];
std::shared_ptr<Opm::Deck> deck_;
std::shared_ptr<Opm::EclipseState> eclipseState_;
std::shared_ptr<Opm::Schedule> schedule_;
std::shared_ptr<Opm::SummaryConfig> summaryConfig_;
std::unique_ptr<Opm::Deck> deck_;
std::unique_ptr<Opm::EclipseState> eclipseState_;
std::unique_ptr<Opm::Schedule> schedule_;
std::unique_ptr<Opm::SummaryConfig> summaryConfig_;
};
} // namespace Opm