Move Connection ordering attribute from Well to WellConnections

This commit is contained in:
Joakim Hove 2020-03-18 14:27:19 +01:00
parent aab9bb8883
commit 805236ee22
2 changed files with 9 additions and 9 deletions

View File

@ -508,7 +508,8 @@ std::size_t packSize(const WellEconProductionLimits& data,
std::size_t packSize(const WellConnections& data,
Dune::MPIHelper::MPICommunicator comm)
{
return packSize(data.getHeadI(), comm) +
return packSize(data.ordering(), comm) +
packSize(data.getHeadI(), comm) +
packSize(data.getHeadJ(), comm) +
packSize(data.getNumRemoved(), comm) +
packSize(data.getConnections(), comm);
@ -641,7 +642,6 @@ std::size_t packSize(const Well& data,
packSize(data.getHeadJ(), comm) +
packSize(data.getRefDepth(), comm) +
packSize(data.wellType(), comm) +
packSize(data.getWellConnectionOrdering(), comm) +
packSize(data.units(), comm) +
packSize(data.udqUndefined(), comm) +
packSize(data.getStatus(), comm) +
@ -1411,6 +1411,7 @@ void pack(const WellConnections& data,
std::vector<char>& buffer, int& position,
Dune::MPIHelper::MPICommunicator comm)
{
pack(data.ordering(), buffer, position, comm);
pack(data.getHeadI(), buffer, position, comm);
pack(data.getHeadJ(), buffer, position, comm);
pack(data.getNumRemoved(), buffer, position, comm);
@ -1548,7 +1549,6 @@ void pack(const Well& data,
pack(data.getHeadJ(), buffer, position, comm);
pack(data.getRefDepth(), buffer, position, comm);
pack(data.wellType(), buffer, position, comm);
pack(data.getWellConnectionOrdering(), buffer, position, comm);
pack(data.units(), buffer, position, comm);
pack(data.udqUndefined(), buffer, position, comm);
pack(data.getStatus(), buffer, position, comm);
@ -2455,14 +2455,16 @@ void unpack(WellConnections& data,
{
int headI, headJ;
size_t numRemoved;
Connection::Order ordering;
std::vector<Connection> connections;
unpack(ordering, buffer, position, comm),
unpack(headI, buffer, position, comm),
unpack(headJ, buffer, position, comm),
unpack(numRemoved, buffer, position, comm),
unpack(connections, buffer, position, comm),
data = WellConnections(headI, headJ, numRemoved, connections);
data = WellConnections(ordering, headI, headJ, numRemoved, connections);
}
void unpack(Well::WellProductionProperties& data,
@ -2668,7 +2670,6 @@ void unpack(Well& data,
int headI, headJ;
double ref_depth;
WellType wtype;
Connection::Order ordering;
UnitSystem units;
double udq_undefined;
Well::Status status;
@ -2696,7 +2697,6 @@ void unpack(Well& data,
unpack(headJ, buffer, position, comm);
unpack(ref_depth, buffer, position, comm);
unpack(wtype, buffer, position, comm);
unpack(ordering, buffer, position, comm);
unpack(units, buffer, position, comm);
unpack(udq_undefined, buffer, position, comm);
unpack(status, buffer, position, comm);
@ -2722,7 +2722,7 @@ void unpack(Well& data,
unpack(*segments, buffer, position, comm);
}
data = Well(name, groupName, firstTimeStep, seqIndex, headI, headJ,
ref_depth, wtype, ordering, units, udq_undefined, status,
ref_depth, wtype, units, udq_undefined, status,
drainageRadius, allowCrossFlow, automaticShutIn,
guideRate, efficiencyFactor, solventFraction, prediction_mode,
econLimits, foamProperties, polymerProperties, brineProperties,

View File

@ -330,7 +330,7 @@ Opm::Well getFullWell()
{
Opm::UnitSystem unitSystem;
return Opm::Well("test1", "test2", 1, 2, 3, 4, 5.0,
Opm::WellType(Opm::Phase::WATER), Opm::Connection::Order::DEPTH,
Opm::WellType(Opm::Phase::WATER),
unitSystem, 6.0, Opm::Well::Status::SHUT,
7.0, true, false,
Opm::Well::WellGuideRate{true, 1.0, Opm::Well::GuideRateTarget::COMB, 2.0},
@ -1473,7 +1473,7 @@ BOOST_AUTO_TEST_CASE(WellConnections)
{9, 10, 11}, Opm::Connection::CTFKind::Defaulted,
12, 13.0, 14.0, true,
15, 16, 17.0);
Opm::WellConnections val1(1, 2, 3, {conn, conn});
Opm::WellConnections val1(Opm::Connection::Order::TRACK, 1, 2, 3, {conn, conn});
auto val2 = PackUnpack(val1);
DO_CHECKS(WellConnections)
#endif