mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Simplify serialization of WellSegments
This commit is contained in:
parent
22d4e784d3
commit
87ddba6028
@ -1432,9 +1432,7 @@ std::size_t packSize(const WellSegments& data,
|
|||||||
Dune::MPIHelper::MPICommunicator comm)
|
Dune::MPIHelper::MPICommunicator comm)
|
||||||
{
|
{
|
||||||
return packSize(data.compPressureDrop(), comm) +
|
return packSize(data.compPressureDrop(), comm) +
|
||||||
packSize(data.segments(), comm) +
|
packSize(data.segments(), comm);
|
||||||
packSize(data.segmentNumberIndex(), comm);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::size_t packSize(const Well& data,
|
std::size_t packSize(const Well& data,
|
||||||
@ -3259,7 +3257,6 @@ void pack(const WellSegments& data,
|
|||||||
{
|
{
|
||||||
pack(data.compPressureDrop(), buffer, position, comm);
|
pack(data.compPressureDrop(), buffer, position, comm);
|
||||||
pack(data.segments(), buffer, position, comm);
|
pack(data.segments(), buffer, position, comm);
|
||||||
pack(data.segmentNumberIndex(), buffer, position, comm);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void pack(const Well& data,
|
void pack(const Well& data,
|
||||||
@ -5726,14 +5723,11 @@ void unpack(WellSegments& data,
|
|||||||
{
|
{
|
||||||
WellSegments::CompPressureDrop compPressureDrop;
|
WellSegments::CompPressureDrop compPressureDrop;
|
||||||
std::vector<Segment> segments;
|
std::vector<Segment> segments;
|
||||||
std::map<int,int> segmentNumberIndex;
|
|
||||||
|
|
||||||
unpack(compPressureDrop, buffer, position, comm);
|
unpack(compPressureDrop, buffer, position, comm);
|
||||||
unpack(segments, buffer, position, comm);
|
unpack(segments, buffer, position, comm);
|
||||||
unpack(segmentNumberIndex, buffer, position, comm);
|
|
||||||
|
|
||||||
data = WellSegments(compPressureDrop,
|
data = WellSegments(compPressureDrop, segments);
|
||||||
segments, segmentNumberIndex);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void unpack(Well& data,
|
void unpack(Well& data,
|
||||||
|
@ -1712,8 +1712,7 @@ BOOST_AUTO_TEST_CASE(WellSegments)
|
|||||||
std::make_shared<Opm::SpiralICD>(),
|
std::make_shared<Opm::SpiralICD>(),
|
||||||
std::make_shared<Opm::Valve>());
|
std::make_shared<Opm::Valve>());
|
||||||
Opm::WellSegments val1(Opm::WellSegments::CompPressureDrop::HF_,
|
Opm::WellSegments val1(Opm::WellSegments::CompPressureDrop::HF_,
|
||||||
{seg, seg},
|
{seg, seg});
|
||||||
{{1,2},{3,4}});
|
|
||||||
|
|
||||||
auto val2 = PackUnpack(val1);
|
auto val2 = PackUnpack(val1);
|
||||||
DO_CHECKS(WellSegments)
|
DO_CHECKS(WellSegments)
|
||||||
|
Loading…
Reference in New Issue
Block a user