mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
collecttoiorank: use elements range generator
This commit is contained in:
parent
2064e8725f
commit
a6509fe077
@ -858,10 +858,8 @@ CollectDataToIORank(const Grid& grid, const EquilGrid* equilGrid,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// loop over all elements (global grid) and store Cartesian index
|
// loop over all elements (global grid) and store Cartesian index
|
||||||
auto elemIt = equilGrid->leafGridView().template begin<0>();
|
for (const auto& elem : elements(equilGrid->leafGridView())) {
|
||||||
const auto& elemEndIt = equilGrid->leafGridView().template end<0>();
|
int elemIdx = equilElemMapper.index(elem);
|
||||||
for (; elemIt != elemEndIt; ++elemIt) {
|
|
||||||
int elemIdx = equilElemMapper.index(*elemIt);
|
|
||||||
int cartElemIdx = equilCartMapper->cartesianIndex(elemIdx);
|
int cartElemIdx = equilCartMapper->cartesianIndex(elemIdx);
|
||||||
globalCartesianIndex_[elemIdx] = cartElemIdx;
|
globalCartesianIndex_[elemIdx] = cartElemIdx;
|
||||||
}
|
}
|
||||||
@ -901,11 +899,8 @@ CollectDataToIORank(const Grid& grid, const EquilGrid* equilGrid,
|
|||||||
distributedCartesianIndex.resize(gridSize, -1);
|
distributedCartesianIndex.resize(gridSize, -1);
|
||||||
|
|
||||||
// A mapping for the whole grid (including the ghosts) is needed for restarts
|
// A mapping for the whole grid (including the ghosts) is needed for restarts
|
||||||
auto eIt = localGridView.template begin<0>();
|
for (const auto& elem : elements(localGridView)) {
|
||||||
const auto& eEndIt = localGridView.template end<0>();
|
int elemIdx = elemMapper.index(elem);
|
||||||
for (; eIt != eEndIt; ++eIt) {
|
|
||||||
const auto element = *eIt;
|
|
||||||
int elemIdx = elemMapper.index(element);
|
|
||||||
distributedCartesianIndex[elemIdx] = cartMapper.cartesianIndex(elemIdx);
|
distributedCartesianIndex[elemIdx] = cartMapper.cartesianIndex(elemIdx);
|
||||||
|
|
||||||
// only store interior element for collection
|
// only store interior element for collection
|
||||||
|
Loading…
Reference in New Issue
Block a user