From 369050cc9c6ac8dd82c7fc0f3040ad6a46ac4563 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Kvalsvik?= Date: Tue, 9 Feb 2016 14:36:12 +0100 Subject: [PATCH] Change Deck access methods/types to references opm-parser#677 changes the return types for the Deck family of classes. This patch fixes all broken code from that patch set. https://github.com/OPM/opm-parser/pull/677 --- opm/simulators/thresholdPressures.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/opm/simulators/thresholdPressures.hpp b/opm/simulators/thresholdPressures.hpp index 8d60cf257..c993d731d 100644 --- a/opm/simulators/thresholdPressures.hpp +++ b/opm/simulators/thresholdPressures.hpp @@ -60,7 +60,7 @@ void computeMaxDp(std::map, double>& maxDp, const int numPhases = initialState.numPhases(); const int numCells = UgGridHelpers::numCells(grid); - const int numPvtRegions = deck->getKeyword("TABDIMS")->getRecord(0)->getItem("NTPVT")->getInt(0); + const int numPvtRegions = deck->getKeyword("TABDIMS").getRecord(0).getItem("NTPVT").get< int >(0); // retrieve the minimum (residual!?) and the maximum saturations for all cells std::vector minSat(numPhases*numCells); @@ -73,26 +73,26 @@ void computeMaxDp(std::map, double>& maxDp, // retrieve the surface densities std::vector > surfaceDensity(numPvtRegions); - Opm::DeckKeywordConstPtr densityKw = deck->getKeyword("DENSITY"); + const auto& densityKw = deck->getKeyword("DENSITY"); for (int regionIdx = 0; regionIdx < numPvtRegions; ++regionIdx) { surfaceDensity[regionIdx].resize(numPhases); if (pu.phase_used[BlackoilPhases::Aqua]) { const int wpos = pu.phase_pos[BlackoilPhases::Aqua]; surfaceDensity[regionIdx][wpos] = - densityKw->getRecord(regionIdx)->getItem("WATER")->getSIDouble(0); + densityKw.getRecord(regionIdx).getItem("WATER").getSIDouble(0); } if (pu.phase_used[BlackoilPhases::Liquid]) { const int opos = pu.phase_pos[BlackoilPhases::Liquid]; surfaceDensity[regionIdx][opos] = - densityKw->getRecord(regionIdx)->getItem("OIL")->getSIDouble(0); + densityKw.getRecord(regionIdx).getItem("OIL").getSIDouble(0); } if (pu.phase_used[BlackoilPhases::Vapour]) { const int gpos = pu.phase_pos[BlackoilPhases::Vapour]; surfaceDensity[regionIdx][gpos] = - densityKw->getRecord(regionIdx)->getItem("GAS")->getSIDouble(0); + densityKw.getRecord(regionIdx).getItem("GAS").getSIDouble(0); } }