From 022f535508484146c4a6797edd3037d133140626 Mon Sep 17 00:00:00 2001 From: Tor Harald Sandve Date: Mon, 27 Nov 2017 11:33:06 +0100 Subject: [PATCH] Fix pvtIndex map for cases with non-active eqlnum regions. --- opm/core/simulator/initStateEquil.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/opm/core/simulator/initStateEquil.hpp b/opm/core/simulator/initStateEquil.hpp index e379dad85..218a2ddb0 100644 --- a/opm/core/simulator/initStateEquil.hpp +++ b/opm/core/simulator/initStateEquil.hpp @@ -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 void setRegionPvtIdx(const Grid& G, const Opm::EclipseState& eclipseState, const RMap& reg) { - regionPvtIdx_.reserve(reg.activeRegions().size()); std::vector cellPvtRegionIdx; extractPvtTableIndex(cellPvtRegionIdx, eclipseState, UgGridHelpers::numCells(G), UgGridHelpers::globalCell(G)); for (const auto& r : reg.activeRegions()) {