From 72bed4449bf20e1da457efeccee441d00d172db9 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Wed, 12 Oct 2022 14:27:20 +0200 Subject: [PATCH] AquiferNumerical: use elements range generator --- opm/simulators/aquifers/AquiferNumerical.hpp | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/opm/simulators/aquifers/AquiferNumerical.hpp b/opm/simulators/aquifers/AquiferNumerical.hpp index a26f1012d..4aa71f647 100644 --- a/opm/simulators/aquifers/AquiferNumerical.hpp +++ b/opm/simulators/aquifers/AquiferNumerical.hpp @@ -176,15 +176,9 @@ private: ElementContext elem_ctx(this->ebos_simulator_); const auto& gridView = this->ebos_simulator_.gridView(); - auto elemIt = gridView.template begin(); - const auto& elemEndIt = gridView.template end(); OPM_BEGIN_PARALLEL_TRY_CATCH(); - for (; elemIt != elemEndIt; ++elemIt) { - const auto& elem = *elemIt; - if (elem.partitionType() != Dune::InteriorEntity) { - continue; - } + for (const auto& elem : elements(gridView, Dune::Partitions::interior)) { elem_ctx.updatePrimaryStencil(elem); const size_t cell_index = elem_ctx.globalSpaceIndex(/*spaceIdx=*/0, /*timeIdx=*/0); @@ -240,13 +234,7 @@ private: ElementContext elem_ctx(this->ebos_simulator_); const auto& gridView = this->ebos_simulator_.gridView(); - 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; - } + for (const auto& elem : elements(gridView, Dune::Partitions::interior)) { // elem_ctx.updatePrimaryStencil(elem); elem_ctx.updateStencil(elem);