mirror of
https://github.com/OPM/opm-simulators.git
synced 2026-09-05 04:40:19 -05:00
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:
@@ -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>>
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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 -----------------
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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 -----------------
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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 -----------------
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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 -----------------
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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 -----------------
|
||||
|
||||
@@ -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 -----------------
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user