Prevent another copy of cell to region mapping in RateConverter.

RateConverter itself already copies this and offers the mapping.
With this commit we just use that.
This commit is contained in:
Markus Blatt 2020-09-07 15:36:07 +02:00
parent 4f7421d64d
commit c21f1e72f8

View File

@ -436,12 +436,7 @@ namespace Opm {
// create map from cell to region
// and set all attributes to zero
const auto& grid = simulator.vanguard().grid();
const unsigned numCells = grid.size(/*codim=*/0);
std::vector<int> cell2region(numCells, -1);
for (const auto& reg : rmap_.activeRegions()) {
for (const auto& cell : rmap_.cells(reg)) {
cell2region[cell] = reg;
}
auto& ra = attr_.attributes(reg);
ra.pressure = 0.0;
ra.temperature = 0.0;
@ -483,7 +478,7 @@ namespace Opm {
hydrocarbon -= fs.saturation(FluidSystem::waterPhaseIdx).value();
}
int reg = cell2region[cellIdx];
int reg = rmap_.region(cellIdx);
assert(reg >= 0);
auto& ra = attr_.attributes(reg);
auto& p = ra.pressure;