From 50e6ca16d6895c6a765c7fc7d392ce439e5bcdc4 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Wed, 12 Oct 2022 14:27:20 +0200 Subject: [PATCH] eclgenericthresholdpressure: use elements and intersections range generators --- ebos/eclgenericthresholdpressure.cc | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/ebos/eclgenericthresholdpressure.cc b/ebos/eclgenericthresholdpressure.cc index 9c0e7066c..9e3f9549d 100644 --- a/ebos/eclgenericthresholdpressure.cc +++ b/ebos/eclgenericthresholdpressure.cc @@ -163,19 +163,8 @@ applyExplicitThresholdPressures_() // set the threshold pressures for all EQUIL region boundaries which have a // intersection in the grid - auto elemIt = gridView_.template begin(); - const auto& elemEndIt = gridView_.template end(); - 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; - + for (const auto& elem : elements(gridView_, Dune::Partitions::interior)) { + for (const auto& intersection : intersections(gridView_, elem)) { if (intersection.boundary()) continue; // ignore boundary intersections for now (TODO?) else if (!intersection.neighbor()) //processor boundary but not domain boundary