mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #2296 from akva2/noecl_no_deck_for_existence
Avoid deck usage on non-root processes checking for keywords
This commit is contained in:
commit
8f52dd34ca
@ -666,10 +666,9 @@ public:
|
|||||||
// disables gravity, else the standard value of the gravity constant at sea level
|
// disables gravity, else the standard value of the gravity constant at sea level
|
||||||
// on earth is used
|
// on earth is used
|
||||||
this->gravity_ = 0.0;
|
this->gravity_ = 0.0;
|
||||||
const auto& deck = simulator.vanguard().deck();
|
|
||||||
if (EWOMS_GET_PARAM(TypeTag, bool, EnableGravity))
|
if (EWOMS_GET_PARAM(TypeTag, bool, EnableGravity))
|
||||||
this->gravity_[dim - 1] = 9.80665;
|
this->gravity_[dim - 1] = 9.80665;
|
||||||
if (deck.hasKeyword("NOGRAV"))
|
if (!eclState.getInitConfig().hasGravity())
|
||||||
this->gravity_[dim - 1] = 0.0;
|
this->gravity_[dim - 1] = 0.0;
|
||||||
|
|
||||||
if (enableTuning_) {
|
if (enableTuning_) {
|
||||||
@ -2467,12 +2466,12 @@ private:
|
|||||||
{
|
{
|
||||||
const auto& simulator = this->simulator();
|
const auto& simulator = this->simulator();
|
||||||
const auto& vanguard = simulator.vanguard();
|
const auto& vanguard = simulator.vanguard();
|
||||||
|
const auto& eclState = vanguard.eclState();
|
||||||
|
|
||||||
const auto& deck = vanguard.deck();
|
if (eclState.getInitConfig().hasEquil())
|
||||||
if (!deck.hasKeyword("EQUIL"))
|
|
||||||
readExplicitInitialCondition_();
|
|
||||||
else
|
|
||||||
readEquilInitialCondition_();
|
readEquilInitialCondition_();
|
||||||
|
else
|
||||||
|
readExplicitInitialCondition_();
|
||||||
|
|
||||||
readBlackoilExtentionsInitialConditions_();
|
readBlackoilExtentionsInitialConditions_();
|
||||||
|
|
||||||
|
@ -591,6 +591,7 @@ std::size_t packSize(const InitConfig& data, Dune::MPIHelper::MPICommunicator co
|
|||||||
return packSize(data.getEquil(), comm) +
|
return packSize(data.getEquil(), comm) +
|
||||||
packSize(data.getFoamConfig(), comm) +
|
packSize(data.getFoamConfig(), comm) +
|
||||||
packSize(data.filleps(), comm) +
|
packSize(data.filleps(), comm) +
|
||||||
|
packSize(data.hasGravity(), comm) +
|
||||||
packSize(data.restartRequested(), comm) +
|
packSize(data.restartRequested(), comm) +
|
||||||
packSize(data.getRestartStep(), comm) +
|
packSize(data.getRestartStep(), comm) +
|
||||||
packSize(data.getRestartRootName(), comm);
|
packSize(data.getRestartRootName(), comm);
|
||||||
@ -2398,6 +2399,7 @@ void pack(const InitConfig& data, std::vector<char>& buffer, int& position,
|
|||||||
pack(data.getEquil(), buffer, position, comm);
|
pack(data.getEquil(), buffer, position, comm);
|
||||||
pack(data.getFoamConfig(), buffer, position, comm);
|
pack(data.getFoamConfig(), buffer, position, comm);
|
||||||
pack(data.filleps(), buffer, position, comm);
|
pack(data.filleps(), buffer, position, comm);
|
||||||
|
pack(data.hasGravity(), buffer, position, comm);
|
||||||
pack(data.restartRequested(), buffer, position, comm);
|
pack(data.restartRequested(), buffer, position, comm);
|
||||||
pack(data.getRestartStep(), buffer, position, comm);
|
pack(data.getRestartStep(), buffer, position, comm);
|
||||||
pack(data.getRestartRootName(), buffer, position, comm);
|
pack(data.getRestartRootName(), buffer, position, comm);
|
||||||
@ -4379,17 +4381,18 @@ void unpack(InitConfig& data, std::vector<char>& buffer, int& position,
|
|||||||
{
|
{
|
||||||
Equil equil;
|
Equil equil;
|
||||||
FoamConfig foam;
|
FoamConfig foam;
|
||||||
bool filleps, restartRequested;
|
bool filleps, hasGravity, restartRequested;
|
||||||
int restartStep;
|
int restartStep;
|
||||||
std::string restartRootName;
|
std::string restartRootName;
|
||||||
unpack(equil, buffer, position, comm);
|
unpack(equil, buffer, position, comm);
|
||||||
unpack(foam, buffer, position, comm);
|
unpack(foam, buffer, position, comm);
|
||||||
unpack(filleps, buffer, position, comm);
|
unpack(filleps, buffer, position, comm);
|
||||||
|
unpack(hasGravity, buffer, position, comm);
|
||||||
unpack(restartRequested, buffer, position, comm);
|
unpack(restartRequested, buffer, position, comm);
|
||||||
unpack(restartStep, buffer, position, comm);
|
unpack(restartStep, buffer, position, comm);
|
||||||
unpack(restartRootName, buffer, position, comm);
|
unpack(restartRootName, buffer, position, comm);
|
||||||
data = InitConfig(equil, foam, filleps, restartRequested,
|
data = InitConfig(equil, foam, filleps, hasGravity,
|
||||||
restartStep, restartRootName);
|
restartRequested, restartStep, restartRootName);
|
||||||
}
|
}
|
||||||
|
|
||||||
void unpack(SimulationConfig& data, std::vector<char>& buffer, int& position,
|
void unpack(SimulationConfig& data, std::vector<char>& buffer, int& position,
|
||||||
|
@ -758,7 +758,7 @@ BOOST_AUTO_TEST_CASE(InitConfig)
|
|||||||
#if HAVE_MPI
|
#if HAVE_MPI
|
||||||
Opm::InitConfig val1(Opm::Equil({getEquilRecord(), getEquilRecord()}),
|
Opm::InitConfig val1(Opm::Equil({getEquilRecord(), getEquilRecord()}),
|
||||||
Opm::FoamConfig({getFoamData(), getFoamData()}),
|
Opm::FoamConfig({getFoamData(), getFoamData()}),
|
||||||
true, true, 20, "test1");
|
true, true, true, 20, "test1");
|
||||||
auto val2 = PackUnpack(val1);
|
auto val2 = PackUnpack(val1);
|
||||||
BOOST_CHECK(std::get<1>(val2) == std::get<2>(val2));
|
BOOST_CHECK(std::get<1>(val2) == std::get<2>(val2));
|
||||||
BOOST_CHECK(val1 == std::get<0>(val2));
|
BOOST_CHECK(val1 == std::get<0>(val2));
|
||||||
@ -2453,7 +2453,7 @@ BOOST_AUTO_TEST_CASE(EclipseConfig)
|
|||||||
"test2", true, "test3", false);
|
"test2", true, "test3", false);
|
||||||
Opm::InitConfig init(Opm::Equil({getEquilRecord(), getEquilRecord()}),
|
Opm::InitConfig init(Opm::Equil({getEquilRecord(), getEquilRecord()}),
|
||||||
Opm::FoamConfig({getFoamData(), getFoamData()}),
|
Opm::FoamConfig({getFoamData(), getFoamData()}),
|
||||||
true, true, 20, "test1");
|
true, true, true, 20, "test1");
|
||||||
Opm::DynamicState<Opm::RestartSchedule> rsched({Opm::RestartSchedule(1, 2, 3)}, 2);
|
Opm::DynamicState<Opm::RestartSchedule> rsched({Opm::RestartSchedule(1, 2, 3)}, 2);
|
||||||
Opm::DynamicState<std::map<std::string,int>> rkw({{{"test",3}}}, 3);
|
Opm::DynamicState<std::map<std::string,int>> rkw({{{"test",3}}}, 3);
|
||||||
Opm::RestartConfig restart(getTimeMap(), 1, true, rsched, rkw, {false, true});
|
Opm::RestartConfig restart(getTimeMap(), 1, true, rsched, rkw, {false, true});
|
||||||
|
Loading…
Reference in New Issue
Block a user