void extractPvtTableIndex(std::vector<int> &pvtTableIdx, const Opm::EclipseState& eclState, size_t numCompressed, const int *compressedToCartesianCellIdx) { //Get the PVTNUM data const std::vector<int>& pvtnumData = eclState.get3DProperties().getIntGridProperty("PVTNUM").getData(); // Convert this into an array of compressed cells // Eclipse uses Fortran-style indices which start at 1 // instead of 0, we subtract 1. pvtTableIdx.resize(numCompressed); for (size_t cellIdx = 0; cellIdx < numCompressed; ++ cellIdx) { size_t cartesianCellIdx = compressedToCartesianCellIdx ? compressedToCartesianCellIdx[cellIdx]:cellIdx; assert(cartesianCellIdx < pvtnumData.size()); pvtTableIdx[cellIdx] = pvtnumData[cartesianCellIdx] - 1; } }