Merge pull request #2314 from bska/serialize-currctrl

Add Parallel Serialization Support for CurrentControl
This commit is contained in:
Joakim Hove 2020-02-06 16:36:02 +01:00 committed by GitHub
commit 28cca881de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 0 deletions

View File

@ -449,6 +449,7 @@ HANDLE_AS_POD(Actdims)
HANDLE_AS_POD(Aqudims)
HANDLE_AS_POD(BCConfig::BCFace)
HANDLE_AS_POD(data::Connection)
HANDLE_AS_POD(data::CurrentControl)
HANDLE_AS_POD(data::Rates)
HANDLE_AS_POD(data::Segment)
HANDLE_AS_POD(DENSITYRecord)
@ -478,6 +479,7 @@ std::size_t packSize(const data::Well& data, Dune::MPIHelper::MPICommunicator co
size += packSize(data.control, comm);
size += packSize(data.connections, comm);
size += packSize(data.segments, comm);
size += packSize(data.current_control, comm);
return size;
}
@ -2194,6 +2196,7 @@ void pack(const data::Well& data, std::vector<char>& buffer, int& position,
pack(data.control, buffer, position, comm);
pack(data.connections, buffer, position, comm);
pack(data.segments, buffer, position, comm);
pack(data.current_control, buffer, position, comm);
}
void pack(const RestartKey& data, std::vector<char>& buffer, int& position,
@ -4084,6 +4087,7 @@ void unpack(data::Well& data, std::vector<char>& buffer, int& position,
unpack(data.control, buffer, position, comm);
unpack(data.connections, buffer, position, comm);
unpack(data.segments, buffer, position, comm);
unpack(data.current_control, buffer, position, comm);
}
void unpack(RestartKey& data, std::vector<char>& buffer, int& position,

View File

@ -664,6 +664,7 @@ ADD_PACK_PROTOTYPES(ColumnSchema)
ADD_PACK_PROTOTYPES(Connection)
ADD_PACK_PROTOTYPES(data::CellData)
ADD_PACK_PROTOTYPES(data::Connection)
ADD_PACK_PROTOTYPES(data::CurrentControl)
ADD_PACK_PROTOTYPES(data::Rates)
ADD_PACK_PROTOTYPES(data::Segment)
ADD_PACK_PROTOTYPES(data::Solution)

View File

@ -164,6 +164,15 @@ Opm::data::Segment getSegment()
}
Opm::data::CurrentControl getCurrentControl()
{
Opm::data::CurrentControl curr;
curr.isProducer = true;
curr.prod = ::Opm::Well::ProducerCMode::CRAT;
return curr;
}
Opm::data::Well getWell()
{
Opm::data::Well well1;
@ -174,6 +183,7 @@ Opm::data::Well getWell()
well1.control = 4;
well1.connections.push_back(getConnection());
well1.segments.insert({0, getSegment()});
well1.current_control = getCurrentControl();
return well1;
}
@ -498,6 +508,17 @@ BOOST_AUTO_TEST_CASE(dataConnection)
}
BOOST_AUTO_TEST_CASE(dataCurrentControl)
{
#if HAVE_MPI
Opm::data::CurrentControl cur1 = getCurrentControl();
auto cur2 = PackUnpack(cur1);
BOOST_CHECK(std::get<1>(cur2) == std::get<2>(cur2));
BOOST_CHECK(cur1 == std::get<0>(cur2));
#endif
}
BOOST_AUTO_TEST_CASE(dataSegment)
{
#if HAVE_MPI