Exemplo n.º 1
0
void SolventPropsAdFromDeck::extractTableIndex(const std::string& keyword,
                                               Opm::EclipseStateConstPtr eclState,
                                               size_t numCompressed,
                                               const int* compressedToCartesianCellIdx,
                                               std::vector<int>& tableIdx) const {
    //Get the Region data
    const std::vector<int>& regionData = eclState->getIntGridProperty(keyword)->getData();
    // Convert this into an array of compressed cells
    // Eclipse uses Fortran-style indices which start at 1
    // instead of 0, we subtract 1.
    tableIdx.resize(numCompressed);
    for (size_t cellIdx = 0; cellIdx < numCompressed; ++ cellIdx) {
        size_t cartesianCellIdx = compressedToCartesianCellIdx ? compressedToCartesianCellIdx[cellIdx]:cellIdx;
        assert(cartesianCellIdx < regionData.size());
        tableIdx[cellIdx] = regionData[cartesianCellIdx] - 1;
    }
}
Exemplo n.º 2
0
void extractPvtTableIndex(std::vector<int> &pvtTableIdx,
                          Opm::EclipseStateConstPtr eclState,
                          size_t numCompressed,
                          const int *compressedToCartesianCellIdx)
{
    //Get the PVTNUM data
    const std::vector<int>& pvtnumData = eclState->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;
    }
}