From 03efc2a60f1d7ca5e70f17fe189c93e1f1cee5c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A5l=20Gr=C3=B8n=C3=A5s=20Drange?= Date: Tue, 12 Apr 2016 17:32:30 +0200 Subject: [PATCH] Using new EclipseState API --- applications/ebos/eclproblem.hh | 39 ++++++++++++----------- applications/ebos/eclthresholdpressure.hh | 2 +- applications/ebos/ecltransmissibility.hh | 2 +- 3 files changed, 22 insertions(+), 21 deletions(-) diff --git a/applications/ebos/eclproblem.hh b/applications/ebos/eclproblem.hh index 405d8f31e..c8461db34 100644 --- a/applications/ebos/eclproblem.hh +++ b/applications/ebos/eclproblem.hh @@ -767,11 +767,11 @@ private: // PVTNUM has not been specified, so everything is in the first region and we // don't need to care... - if (!eclState->hasDeckIntGridProperty("PVTNUM")) + if (!eclState->get3DProperties().hasDeckIntGridProperty("PVTNUM")) return; const std::vector& pvtnumData = - eclState->getIntGridProperty("PVTNUM")->getData(); + eclState->get3DProperties().getIntGridProperty("PVTNUM").getData(); unsigned numElem = gridManager.gridView().size(0); rockTableIdx_.resize(numElem); for (size_t elemIdx = 0; elemIdx < numElem; ++ elemIdx) { @@ -787,6 +787,7 @@ private: const auto& gridManager = this->simulator().gridManager(); Opm::DeckConstPtr deck = gridManager.deck(); Opm::EclipseStateConstPtr eclState = gridManager.eclState(); + const auto& props = eclState->get3DProperties(); size_t numDof = this->model().numGridDof(); @@ -799,15 +800,15 @@ private: // read the intrinsic permeabilities from the eclState. Note that all arrays // provided by eclState are one-per-cell of "uncompressed" grid, whereas the // opm-grid CpGrid object might remove a few elements... - if (eclState->hasDeckDoubleGridProperty("PERMX")) { - const std::vector &permxData = - eclState->getDoubleGridProperty("PERMX")->getData(); + if (props.hasDeckDoubleGridProperty("PERMX")) { + const std::vector &permxData = + props.getDoubleGridProperty("PERMX").getData(); std::vector permyData(permxData); - if (eclState->hasDeckDoubleGridProperty("PERMY")) - permyData = eclState->getDoubleGridProperty("PERMY")->getData(); + if (props.hasDeckDoubleGridProperty("PERMY")) + permyData = props.getDoubleGridProperty("PERMY").getData(); std::vector permzData(permxData); - if (eclState->hasDeckDoubleGridProperty("PERMZ")) - permzData = eclState->getDoubleGridProperty("PERMZ")->getData(); + if (props.hasDeckDoubleGridProperty("PERMZ")) + permzData = props.getDoubleGridProperty("PERMZ").getData(); for (size_t dofIdx = 0; dofIdx < numDof; ++ dofIdx) { unsigned cartesianElemIdx = gridManager.cartesianIndex(dofIdx); @@ -828,14 +829,14 @@ private: //////////////////////////////// // compute the porosity - if (!eclState->hasDeckDoubleGridProperty("PORO") && !eclState->hasDeckDoubleGridProperty("PORV")) + if (!props.hasDeckDoubleGridProperty("PORO") && !props.hasDeckDoubleGridProperty("PORV")) OPM_THROW(std::runtime_error, "Can't read the porosity from the ECL state object. " "(The PORO and PORV keywords are missing)"); - if (eclState->hasDeckDoubleGridProperty("PORO")) { + if (props.hasDeckDoubleGridProperty("PORO")) { const std::vector &poroData = - eclState->getDoubleGridProperty("PORO")->getData(); + props.getDoubleGridProperty("PORO").getData(); for (size_t dofIdx = 0; dofIdx < numDof; ++ dofIdx) { unsigned cartesianElemIdx = gridManager.cartesianIndex(dofIdx); @@ -844,18 +845,18 @@ private: } // apply the NTG keyword to the porosity - if (eclState->hasDeckDoubleGridProperty("NTG")) { + if (props.hasDeckDoubleGridProperty("NTG")) { const std::vector &ntgData = - eclState->getDoubleGridProperty("NTG")->getData(); + props.getDoubleGridProperty("NTG").getData(); for (size_t dofIdx = 0; dofIdx < numDof; ++ dofIdx) porosity_[dofIdx] *= ntgData[gridManager.cartesianIndex(dofIdx)]; } // apply the MULTPV keyword to the porosity - if (eclState->hasDeckDoubleGridProperty("MULTPV")) { + if (props.hasDeckDoubleGridProperty("MULTPV")) { const std::vector &multpvData = - eclState->getDoubleGridProperty("MULTPV")->getData(); + props.getDoubleGridProperty("MULTPV").getData(); for (size_t dofIdx = 0; dofIdx < numDof; ++ dofIdx) porosity_[dofIdx] *= multpvData[gridManager.cartesianIndex(dofIdx)]; @@ -863,9 +864,9 @@ private: // overwrite the porosity using the PORV keyword for the elements for which PORV // is defined... - if (eclState->hasDeckDoubleGridProperty("PORV")) { + if (props.hasDeckDoubleGridProperty("PORV")) { const std::vector &porvData = - eclState->getDoubleGridProperty("PORV")->getData(); + props.getDoubleGridProperty("PORV").getData(); for (size_t dofIdx = 0; dofIdx < numDof; ++ dofIdx) { unsigned cartesianElemIdx = gridManager.cartesianIndex(dofIdx); @@ -977,7 +978,7 @@ private: rvData = &deck->getKeyword("RV").getSIDoubleData(); // initial reservoir temperature const std::vector &tempiData = - eclState->getDoubleGridProperty("TEMPI")->getData(); + eclState->get3DProperties().getDoubleGridProperty("TEMPI").getData(); // make sure that the size of the data arrays is correct #ifndef NDEBUG diff --git a/applications/ebos/eclthresholdpressure.hh b/applications/ebos/eclthresholdpressure.hh index c81752af0..ab4345ca8 100644 --- a/applications/ebos/eclthresholdpressure.hh +++ b/applications/ebos/eclthresholdpressure.hh @@ -122,7 +122,7 @@ public: // internalize the data specified using the EQLNUM keyword const std::vector& equilRegionData = - eclState->getIntGridProperty("EQLNUM")->getData(); + eclState->get3DProperties().getIntGridProperty("EQLNUM").getData(); elemEquilRegion_.resize(numElements, 0); for (unsigned elemIdx = 0; elemIdx < numElements; ++elemIdx) { int cartElemIdx = gridManager.cartesianIndex(elemIdx); diff --git a/applications/ebos/ecltransmissibility.hh b/applications/ebos/ecltransmissibility.hh index 3d2990ead..c9c064056 100644 --- a/applications/ebos/ecltransmissibility.hh +++ b/applications/ebos/ecltransmissibility.hh @@ -143,7 +143,7 @@ public: Opm::EclipseStateConstPtr eclState = gridManager.eclState(); std::shared_ptr transMult = eclState->getTransMult(); const std::vector& ntg = - eclState->getDoubleGridProperty("NTG")->getData(); + eclState->get3DProperties().getDoubleGridProperty("NTG").getData(); // reserving some space in the hashmap upfront saves quite a bit of time because // resizes are costly for hashmaps and there would be quite a few of them if we