output the cells which the simulator classes consider active

copying the EclipseGrid object is required as the final set of active
cells requires knowledge of the grid used by the simulator which is
not available in opm-parser. In turn, this requires to call
EclipseGrid::resetACTNUM() which is non-const.
This commit is contained in:
Andreas Lauser 2014-07-17 21:47:11 +02:00
parent dc5fc64e98
commit 597735b7d0

View File

@ -483,7 +483,18 @@ public:
auto dataField = eclipseState->getDoubleGridProperty("PORO")->getData();
restrictToActiveCells(dataField, numCells, compressedToCartesianCellIdx);
auto eclGrid = eclipseState->getEclipseGrid();
auto eclGrid = eclipseState->getEclipseGridCopy();
// update the ACTNUM array using the processed cornerpoint grid
std::vector<int> actnumData(eclGrid->getCartesianSize(), 1);
if (compressedToCartesianCellIdx) {
std::fill(actnumData.begin(), actnumData.end(), 0);
for (int cellIdx = 0; cellIdx < numCells; ++cellIdx) {
int cartesianCellIdx = compressedToCartesianCellIdx[cellIdx];
actnumData[cartesianCellIdx] = 1;
}
}
eclGrid->resetACTNUM(&actnumData[0]);
// finally, write the grid to disk
eclGrid->fwriteEGRID(egridFileName_.ertHandle());