From 0cb3e1426c4e236554066209a2bb318e76d335cc 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 WellProductionProperties --- opm/simulators/utils/ParallelRestart.cpp | 88 ------------------------ opm/simulators/utils/ParallelRestart.hpp | 1 - tests/test_ParallelRestart.cpp | 2 +- 3 files changed, 1 insertion(+), 90 deletions(-) diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index d1ccf6869..1871ed125 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -367,29 +367,6 @@ std::size_t packSize(const Well::WellInjectionProperties& data, packSize(data.controlMode, comm); } -std::size_t packSize(const Well::WellProductionProperties& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.name, comm) + - packSize(data.OilRate, comm) + - packSize(data.WaterRate, comm) + - packSize(data.GasRate, comm) + - packSize(data.LiquidRate, comm) + - packSize(data.ResVRate, comm) + - packSize(data.BHPTarget, comm) + - packSize(data.THPTarget, comm) + - packSize(data.bhp_hist_limit, comm) + - packSize(data.thp_hist_limit, comm) + - packSize(data.BHPH, comm) + - packSize(data.THPH, comm) + - packSize(data.VFPTableNumber, comm) + - packSize(data.ALQValue, comm) + - packSize(data.predictionMode, comm) + - packSize(data.controlMode, comm) + - packSize(data.whistctl_cmode, comm) + - packSize(data.getNumProductionControls(), comm); -} - std::size_t packSize(const SpiralICD& data, Dune::MPIHelper::MPICommunicator comm) { @@ -899,30 +876,6 @@ void pack(const Well::WellInjectionProperties& data, pack(data.controlMode, buffer, position, comm); } -void pack(const Well::WellProductionProperties& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.name, buffer, position, comm); - pack(data.OilRate, buffer, position, comm); - pack(data.WaterRate, buffer, position, comm); - pack(data.GasRate, buffer, position, comm); - pack(data.LiquidRate, buffer, position, comm); - pack(data.ResVRate, buffer, position, comm); - pack(data.BHPTarget, buffer, position, comm); - pack(data.THPTarget, buffer, position, comm); - pack(data.bhp_hist_limit, buffer, position, comm); - pack(data.thp_hist_limit, buffer, position, comm); - pack(data.BHPH, buffer, position, comm); - pack(data.THPH, buffer, position, comm); - pack(data.VFPTableNumber, buffer, position, comm); - pack(data.ALQValue, buffer, position, comm); - pack(data.predictionMode, buffer, position, comm); - pack(data.controlMode, buffer, position, comm); - pack(data.whistctl_cmode, buffer, position, comm); - pack(data.getNumProductionControls(), buffer, position, comm); -} - void pack(const SpiralICD& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -1483,47 +1436,6 @@ void unpack(Well::WellInjectionProperties& data, unpack(data.controlMode, buffer, position, comm); } -void unpack(Well::WellProductionProperties& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - std::string name; - UDAValue OilRate, WaterRate, GasRate, LiquidRate, ResVRate; - UDAValue BHPTarget, THPTarget; - double bhp_hist_limit, thp_hist_limit; - double BHPH, THPH; - int VFPTableNumber; - double ALQValue; - bool predictionMode; - Well::ProducerCMode controlMode, whistctl_cmode; - int prodCtrls; - - unpack(name, buffer, position, comm); - unpack(OilRate, buffer, position, comm); - unpack(WaterRate, buffer, position, comm); - unpack(GasRate, buffer, position, comm); - unpack(LiquidRate, buffer, position, comm); - unpack(ResVRate, buffer, position, comm); - unpack(BHPTarget, buffer, position, comm); - unpack(THPTarget, buffer, position, comm); - unpack(bhp_hist_limit, buffer, position, comm); - unpack(thp_hist_limit, buffer, position, comm); - unpack(BHPH, buffer, position, comm); - unpack(THPH, buffer, position, comm); - unpack(VFPTableNumber, buffer, position, comm); - unpack(ALQValue, buffer, position, comm); - unpack(predictionMode, buffer, position, comm); - unpack(controlMode, buffer, position, comm); - unpack(whistctl_cmode, buffer, position, comm); - unpack(prodCtrls, buffer, position, comm); - data = Well::WellProductionProperties(name, OilRate, WaterRate, GasRate, - LiquidRate, ResVRate, BHPTarget, - THPTarget, bhp_hist_limit, thp_hist_limit, - BHPH, THPH, VFPTableNumber, - ALQValue, predictionMode, controlMode, - whistctl_cmode, prodCtrls); -} - void unpack(SpiralICD& 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 3d10b083c..14c144af0 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -386,7 +386,6 @@ ADD_PACK_PROTOTYPES(VFPProdTable) ADD_PACK_PROTOTYPES(Well) ADD_PACK_PROTOTYPES(WellType) ADD_PACK_PROTOTYPES(Well::WellInjectionProperties) -ADD_PACK_PROTOTYPES(Well::WellProductionProperties) ADD_PACK_PROTOTYPES(WellSegments) } // end namespace Mpi diff --git a/tests/test_ParallelRestart.cpp b/tests/test_ParallelRestart.cpp index 82cc5da08..439cde3c6 100644 --- a/tests/test_ParallelRestart.cpp +++ b/tests/test_ParallelRestart.cpp @@ -1498,7 +1498,7 @@ BOOST_AUTO_TEST_CASE(WellProductionProperties) true, Opm::Well::ProducerCMode::CRAT, Opm::Well::ProducerCMode::BHP, 11); - auto val2 = PackUnpack(val1); + auto val2 = PackUnpack2(val1); DO_CHECKS(Well::WellProductionProperties) #endif }