From bc33e482beee1fe8373852592f5046910aae4c26 Mon Sep 17 00:00:00 2001 From: Tor Harald Sandve Date: Fri, 10 Jan 2020 09:02:16 +0100 Subject: [PATCH] don't communicate isoThermal when approach is NoWaterPvt --- opm/simulators/utils/ParallelRestart.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index b89f32502..3e6603fff 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -940,7 +940,8 @@ std::size_t packSize(const WaterPvtThermal& data, packSize(data.enableThermalViscosity(), comm) + packSize(data.enableInternalEnergy(), comm); size += packSize(bool(), comm); - if (data.isoThermalPvt()) + using PvtApproach = WaterPvtThermal; + if (data.isoThermalPvt()->approach() != PvtApproach::IsothermalPvt::NoWaterPvt) size += packSize(*data.isoThermalPvt(), comm); return size; @@ -2624,7 +2625,9 @@ void pack(const WaterPvtThermal& data, pack(data.enableThermalViscosity(), buffer, position, comm); pack(data.enableInternalEnergy(), buffer, position, comm); pack(data.isoThermalPvt() != nullptr, buffer, position, comm); - if (data.isoThermalPvt()) + + using PvtApproach = WaterPvtThermal; + if (data.isoThermalPvt()->approach() != PvtApproach::IsothermalPvt::NoWaterPvt) pack(*data.isoThermalPvt(), buffer, position, comm); } @@ -4671,7 +4674,9 @@ void unpack(WaterPvtThermal& data, typename WaterPvtThermal::IsothermalPvt* pvt = nullptr; if (isothermal) { pvt = new typename WaterPvtThermal::IsothermalPvt; - unpack(*pvt, buffer, position, comm); + using PvtApproach = WaterPvtThermal; + if (pvt->approach() != PvtApproach::IsothermalPvt::NoWaterPvt) + unpack(*pvt, buffer, position, comm); } data = WaterPvtThermal(pvt, viscrefPress, watdentRefTemp, watdentCT1, watdentCT2,