mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Parallel Restart: Chase RFTConfig API Update
The RFTConfig object gained a new data member and constructor argument, in addition to altering the type of the data member well_open_rft_name from an unordered_set to an unordered_map. Update serialization code accordingly.
This commit is contained in:
parent
0e9535319b
commit
b455faf067
@ -1500,6 +1500,7 @@ std::size_t packSize(const RFTConfig& data,
|
|||||||
Dune::MPIHelper::MPICommunicator comm)
|
Dune::MPIHelper::MPICommunicator comm)
|
||||||
{
|
{
|
||||||
return packSize(data.timeMap(), comm) +
|
return packSize(data.timeMap(), comm) +
|
||||||
|
packSize(data.firstRFTOutput(), comm) +
|
||||||
packSize(data.wellOpenRftTime(), comm) +
|
packSize(data.wellOpenRftTime(), comm) +
|
||||||
packSize(data.wellOpenRftName(), comm) +
|
packSize(data.wellOpenRftName(), comm) +
|
||||||
packSize(data.wellOpen(), comm) +
|
packSize(data.wellOpen(), comm) +
|
||||||
@ -3224,6 +3225,7 @@ void pack(const RFTConfig& data,
|
|||||||
Dune::MPIHelper::MPICommunicator comm)
|
Dune::MPIHelper::MPICommunicator comm)
|
||||||
{
|
{
|
||||||
pack(data.timeMap(), buffer, position, comm);
|
pack(data.timeMap(), buffer, position, comm);
|
||||||
|
pack(data.firstRFTOutput(), buffer, position, comm);
|
||||||
pack(data.wellOpenRftTime(), buffer, position, comm);
|
pack(data.wellOpenRftTime(), buffer, position, comm);
|
||||||
pack(data.wellOpenRftName(), buffer, position, comm);
|
pack(data.wellOpenRftName(), buffer, position, comm);
|
||||||
pack(data.wellOpen(), buffer, position, comm);
|
pack(data.wellOpen(), buffer, position, comm);
|
||||||
@ -5575,19 +5577,21 @@ void unpack(RFTConfig& data,
|
|||||||
Dune::MPIHelper::MPICommunicator comm)
|
Dune::MPIHelper::MPICommunicator comm)
|
||||||
{
|
{
|
||||||
TimeMap timeMap;
|
TimeMap timeMap;
|
||||||
|
std::size_t first_rft;
|
||||||
std::pair<bool, std::size_t> wellOpenRftTime;
|
std::pair<bool, std::size_t> wellOpenRftTime;
|
||||||
std::unordered_set<std::string> wellOpenRftName;
|
RFTConfig::WellOpenTimeMap wellOpenRftName;
|
||||||
std::unordered_map<std::string, std::size_t> wellOpen;
|
RFTConfig::WellOpenTimeMap wellOpen;
|
||||||
RFTConfig::RFTMap rftConfig;
|
RFTConfig::RFTMap rftConfig;
|
||||||
RFTConfig::PLTMap pltConfig;
|
RFTConfig::PLTMap pltConfig;
|
||||||
|
|
||||||
unpack(timeMap, buffer, position, comm);
|
unpack(timeMap, buffer, position, comm);
|
||||||
|
unpack(first_rft, buffer, position, comm);
|
||||||
unpack(wellOpenRftTime, buffer, position, comm);
|
unpack(wellOpenRftTime, buffer, position, comm);
|
||||||
unpack(wellOpenRftName, buffer, position, comm);
|
unpack(wellOpenRftName, buffer, position, comm);
|
||||||
unpack(wellOpen, buffer, position, comm);
|
unpack(wellOpen, buffer, position, comm);
|
||||||
unpack(rftConfig, buffer, position, comm);
|
unpack(rftConfig, buffer, position, comm);
|
||||||
unpack(pltConfig, buffer, position, comm);
|
unpack(pltConfig, buffer, position, comm);
|
||||||
data = RFTConfig(timeMap, wellOpenRftTime, wellOpenRftName,
|
data = RFTConfig(timeMap, first_rft, wellOpenRftTime, wellOpenRftName,
|
||||||
wellOpen, rftConfig, pltConfig);
|
wellOpen, rftConfig, pltConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2076,8 +2076,9 @@ BOOST_AUTO_TEST_CASE(RFTConfig)
|
|||||||
{
|
{
|
||||||
#ifdef HAVE_MPI
|
#ifdef HAVE_MPI
|
||||||
Opm::RFTConfig val1(getTimeMap(),
|
Opm::RFTConfig val1(getTimeMap(),
|
||||||
|
std::size_t{1729},
|
||||||
{true, 1},
|
{true, 1},
|
||||||
{"test1", "test2"},
|
{{"test1", 2}, {"test2", 3}},
|
||||||
{{"test3", 2}},
|
{{"test3", 2}},
|
||||||
{{"test1", {{{Opm::RFTConfig::RFT::TIMESTEP, 3}}, 4}}},
|
{{"test1", {{{Opm::RFTConfig::RFT::TIMESTEP, 3}}, 4}}},
|
||||||
{{"test2", {{{Opm::RFTConfig::PLT::REPT, 5}}, 6}}});
|
{{"test2", {{{Opm::RFTConfig::PLT::REPT, 5}}, 6}}});
|
||||||
@ -2309,8 +2310,9 @@ BOOST_AUTO_TEST_CASE(Schedule)
|
|||||||
Opm::Action::Actions acnts({getActionX()});
|
Opm::Action::Actions acnts({getActionX()});
|
||||||
|
|
||||||
Opm::RFTConfig rftc(getTimeMap(),
|
Opm::RFTConfig rftc(getTimeMap(),
|
||||||
|
std::size_t{1729},
|
||||||
{true, 1},
|
{true, 1},
|
||||||
{"test1", "test2"},
|
{{"test1", 2}, {"test2", 3}},
|
||||||
{{"test3", 2}},
|
{{"test3", 2}},
|
||||||
{{"test1", {{{Opm::RFTConfig::RFT::TIMESTEP, 3}}, 4}}},
|
{{"test1", {{{Opm::RFTConfig::RFT::TIMESTEP, 3}}, 4}}},
|
||||||
{{"test2", {{{Opm::RFTConfig::PLT::REPT, 5}}, 6}}});
|
{{"test2", {{{Opm::RFTConfig::PLT::REPT, 5}}, 6}}});
|
||||||
|
Loading…
Reference in New Issue
Block a user