mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -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 <opm/simulators/utils/DeferredLoggingErrorHelpers.hpp>
|
||||||
|
|
||||||
#include <dune/grid/common/gridenums.hh>
|
#include <dune/grid/common/gridenums.hh>
|
||||||
|
#include <dune/grid/common/rangegenerators.hh>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
@ -116,18 +117,9 @@ namespace Opm {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ElementContext elemCtx( simulator );
|
ElementContext elemCtx( simulator );
|
||||||
const auto& elemEndIt = gridView.template end</*codim=*/0>();
|
|
||||||
OPM_BEGIN_PARALLEL_TRY_CATCH();
|
OPM_BEGIN_PARALLEL_TRY_CATCH();
|
||||||
|
for (const auto& elem : elements(gridView, Dune::Partitions::interior)) {
|
||||||
for (auto elemIt = gridView.template begin</*codim=*/0>();
|
|
||||||
elemIt != elemEndIt;
|
|
||||||
++elemIt)
|
|
||||||
{
|
|
||||||
|
|
||||||
const auto& elem = *elemIt;
|
|
||||||
if (elem.partitionType() != Dune::InteriorEntity)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
elemCtx.updatePrimaryStencil(elem);
|
elemCtx.updatePrimaryStencil(elem);
|
||||||
elemCtx.updatePrimaryIntensiveQuantities(/*timeIdx=*/0);
|
elemCtx.updatePrimaryIntensiveQuantities(/*timeIdx=*/0);
|
||||||
const unsigned cellIdx = elemCtx.globalSpaceIndex(/*spaceIdx=*/0, /*timeIdx=*/0);
|
const unsigned cellIdx = elemCtx.globalSpaceIndex(/*spaceIdx=*/0, /*timeIdx=*/0);
|
||||||
|
Loading…
Reference in New Issue
Block a user