mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-01-26 19:46:24 -06:00
RegionAverageCalculator: use elements range generator
This commit is contained in:
parent
5796396696
commit
ff826aa939
@ -25,6 +25,7 @@
|
||||
#include <opm/simulators/utils/DeferredLoggingErrorHelpers.hpp>
|
||||
|
||||
#include <dune/grid/common/gridenums.hh>
|
||||
#include <dune/grid/common/rangegenerators.hh>
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <memory>
|
||||
@ -116,18 +117,9 @@ namespace Opm {
|
||||
}
|
||||
|
||||
ElementContext elemCtx( simulator );
|
||||
const auto& elemEndIt = gridView.template end</*codim=*/0>();
|
||||
|
||||
OPM_BEGIN_PARALLEL_TRY_CATCH();
|
||||
|
||||
for (auto elemIt = gridView.template begin</*codim=*/0>();
|
||||
elemIt != elemEndIt;
|
||||
++elemIt)
|
||||
{
|
||||
|
||||
const auto& elem = *elemIt;
|
||||
if (elem.partitionType() != Dune::InteriorEntity)
|
||||
continue;
|
||||
|
||||
for (const auto& elem : elements(gridView, Dune::Partitions::interior)) {
|
||||
elemCtx.updatePrimaryStencil(elem);
|
||||
elemCtx.updatePrimaryIntensiveQuantities(/*timeIdx=*/0);
|
||||
const unsigned cellIdx = elemCtx.globalSpaceIndex(/*spaceIdx=*/0, /*timeIdx=*/0);
|
||||
|
Loading…
Reference in New Issue
Block a user