mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #2772 from blattms/prevent-copy-in-rateconverter
Prevent another copy of cell to region mapping in RateConverter.
This commit is contained in:
@@ -435,13 +435,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 +477,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;
|
||||
|
||||
Reference in New Issue
Block a user