adapt to the change of the API due to using compressed instead of cartesian indices

This commit is contained in:
Andreas Lauser
2015-08-03 16:22:20 +02:00
parent a394af6734
commit 0e5d8da66b
3 changed files with 68 additions and 1 deletions

View File

@@ -251,9 +251,21 @@ try
const PhaseUsage pu = Opm::phaseUsageFromDeck(deck);
Opm::BlackoilOutputWriter outputWriter(grid, param, eclipseState, pu );
int numCells = Opm::UgGridHelpers::numCells(grid);
const auto& globalCell = Opm::UgGridHelpers::globalCell(grid);
std::vector<int> compressedToCartesianIdx(numCells);
for (unsigned cellIdx = 0; cellIdx < numCells; ++cellIdx) {
if (globalCell) {
compressedToCartesianIdx[cellIdx] = globalCell[cellIdx];
}
else {
compressedToCartesianIdx[cellIdx] = cellIdx;
}
}
typedef BlackoilPropsAdFromDeck::MaterialLawManager MaterialLawManager;
auto materialLawManager = std::make_shared<MaterialLawManager>();
materialLawManager->initFromDeck(deck, eclipseState);
materialLawManager->initFromDeck(deck, eclipseState, compressedToCartesianIdx);
// Rock and fluid init
BlackoilPropertiesFromDeck props( deck, eclipseState, materialLawManager,