Fix pvtIndex map for cases with non-active eqlnum regions.

This commit is contained in:
Tor Harald Sandve 2017-11-27 11:33:06 +01:00 committed by Andreas Lauser
parent 54e751fe70
commit 022f535508

View File

@ -263,6 +263,8 @@ namespace Opm
const auto& tables = eclipseState.getTableManager();
// Create (inverse) region mapping.
const RegionMapping<> eqlmap(equilnum(eclipseState, G));
const int invalidRegion = -1;
regionPvtIdx_.resize(rec.size(), invalidRegion);
setRegionPvtIdx(G, eclipseState, eqlmap);
// Create Rs functions.
@ -371,7 +373,6 @@ namespace Opm
template<class Grid, class RMap>
void setRegionPvtIdx(const Grid& G, const Opm::EclipseState& eclipseState, const RMap& reg) {
regionPvtIdx_.reserve(reg.activeRegions().size());
std::vector<int> cellPvtRegionIdx;
extractPvtTableIndex(cellPvtRegionIdx, eclipseState, UgGridHelpers::numCells(G), UgGridHelpers::globalCell(G));
for (const auto& r : reg.activeRegions()) {