From fde0e42e8d76b52b0b92c2041250d3d81cc5913c Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Wed, 18 Mar 2020 09:29:02 +0100 Subject: [PATCH] remove old serialization support for Segment --- opm/simulators/utils/ParallelRestart.cpp | 71 ------------------------ opm/simulators/utils/ParallelRestart.hpp | 2 - tests/test_ParallelRestart.cpp | 2 +- 3 files changed, 1 insertion(+), 74 deletions(-) diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index 9289459c5..9d957085d 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -345,25 +345,6 @@ std::size_t packSize(const UDAValue& data, packSize(data.get(), comm)); } -std::size_t packSize(const Segment& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.segmentNumber(), comm) + - packSize(data.branchNumber(), comm) + - packSize(data.outletSegment(), comm) + - packSize(data.inletSegments(), comm) + - packSize(data.totalLength(), comm) + - packSize(data.depth(), comm) + - packSize(data.internalDiameter(), comm) + - packSize(data.roughness(), comm) + - packSize(data.crossArea(), comm) + - packSize(data.volume(), comm) + - packSize(data.dataReady(), comm) + - packSize(data.segmentType(), comm) + - packSize(data.spiralICD(), comm) + - packSize(data.getValve(), comm); -} - template std::size_t packSize(const std::shared_ptr& data, Dune::MPIHelper::MPICommunicator comm) @@ -804,26 +785,6 @@ void pack(const UDAValue& data, pack(data.get(), buffer, position, comm); } -void pack(const Segment& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.segmentNumber(), buffer, position, comm); - pack(data.branchNumber(), buffer, position, comm); - pack(data.outletSegment(), buffer, position, comm); - pack(data.inletSegments(), buffer, position, comm); - pack(data.totalLength(), buffer, position, comm); - pack(data.depth(), buffer, position, comm); - pack(data.internalDiameter(), buffer, position, comm); - pack(data.roughness(), buffer, position, comm); - pack(data.crossArea(), buffer, position, comm); - pack(data.volume(), buffer, position, comm); - pack(data.dataReady(), buffer, position, comm); - pack(data.segmentType(), buffer, position, comm); - pack(data.spiralICD(), buffer, position, comm); - pack(data.getValve(), buffer, position, comm); -} - template void pack(const std::shared_ptr& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -1312,38 +1273,6 @@ void unpack(UDAValue& data, } } -void unpack(Segment& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - int segmentNumber, branchNumber, outletSegment; - std::vector inletSegments; - double totalLength, depth, internalDiameter, roughness, crossArea, volume; - bool dataReady; - Segment::SegmentType segmentType; - std::shared_ptr spiralICD; - std::shared_ptr valve; - - unpack(segmentNumber, buffer, position, comm); - unpack(branchNumber, buffer, position, comm); - unpack(outletSegment, buffer, position, comm); - unpack(inletSegments, buffer, position, comm); - unpack(totalLength, buffer, position, comm); - unpack(depth, buffer, position, comm); - unpack(internalDiameter, buffer, position, comm); - unpack(roughness, buffer, position, comm); - unpack(crossArea, buffer, position, comm); - unpack(volume, buffer, position, comm); - unpack(dataReady, buffer, position, comm); - unpack(segmentType, buffer, position, comm); - unpack(spiralICD, buffer, position, comm); - unpack(valve, buffer, position, comm); - data = Segment(segmentNumber, branchNumber, outletSegment, - inletSegments, totalLength, depth, - internalDiameter, roughness, crossArea, - volume, dataReady, segmentType, spiralICD, valve); -} - template void unpack(std::shared_ptr& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index 1f98d653f..f347cecd3 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -44,7 +44,6 @@ namespace Opm class Dimension; template class IOrderSet; -class Segment; class UDAValue; class UnitSystem; class VFPInjTable; @@ -373,7 +372,6 @@ ADD_PACK_PROTOTYPES(Group::GroupInjectionProperties) ADD_PACK_PROTOTYPES(Group::GroupProductionProperties) ADD_PACK_PROTOTYPES(RestartKey) ADD_PACK_PROTOTYPES(RestartValue) -ADD_PACK_PROTOTYPES(Segment) ADD_PACK_PROTOTYPES(std::string) ADD_PACK_PROTOTYPES(UDAValue) ADD_PACK_PROTOTYPES(UnitSystem) diff --git a/tests/test_ParallelRestart.cpp b/tests/test_ParallelRestart.cpp index d8955e849..456a9dbea 100644 --- a/tests/test_ParallelRestart.cpp +++ b/tests/test_ParallelRestart.cpp @@ -1532,7 +1532,7 @@ BOOST_AUTO_TEST_CASE(Segment) Opm::Segment::SegmentType::SICD, std::make_shared(), std::make_shared()); - auto val2 = PackUnpack(val1); + auto val2 = PackUnpack2(val1); DO_CHECKS(Segment) #endif }