eclgenericthresholdpressure: use elements and intersections range generators

This commit is contained in:
Arne Morten Kvarving 2022-10-12 14:27:20 +02:00
parent 82b29f113a
commit 50e6ca16d6

View File

@ -163,19 +163,8 @@ applyExplicitThresholdPressures_()
// set the threshold pressures for all EQUIL region boundaries which have a // set the threshold pressures for all EQUIL region boundaries which have a
// intersection in the grid // intersection in the grid
auto elemIt = gridView_.template begin</*codim=*/ 0>(); for (const auto& elem : elements(gridView_, Dune::Partitions::interior)) {
const auto& elemEndIt = gridView_.template end</*codim=*/ 0>(); for (const auto& intersection : intersections(gridView_, elem)) {
for (; elemIt != elemEndIt; ++elemIt) {
const auto& elem = *elemIt;
if (elem.partitionType() != Dune::InteriorEntity)
continue;
auto isIt = gridView_.ibegin(elem);
const auto& isEndIt = gridView_.iend(elem);
for (; isIt != isEndIt; ++ isIt) {
// store intersection, this might be costly
const auto& intersection = *isIt;
if (intersection.boundary()) if (intersection.boundary())
continue; // ignore boundary intersections for now (TODO?) continue; // ignore boundary intersections for now (TODO?)
else if (!intersection.neighbor()) //processor boundary but not domain boundary else if (!intersection.neighbor()) //processor boundary but not domain boundary