mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
BlackoilModelEbos: use elements range generator
This commit is contained in:
parent
ada17881cc
commit
72dfc63167
@ -453,13 +453,7 @@ namespace Opm {
|
|||||||
|
|
||||||
const auto& elemMapper = ebosSimulator_.model().elementMapper();
|
const auto& elemMapper = ebosSimulator_.model().elementMapper();
|
||||||
const auto& gridView = ebosSimulator_.gridView();
|
const auto& gridView = ebosSimulator_.gridView();
|
||||||
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 (; elemIt != elemEndIt; ++elemIt) {
|
|
||||||
const auto& elem = *elemIt;
|
|
||||||
if (elem.partitionType() != Dune::InteriorEntity)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
unsigned globalElemIdx = elemMapper.index(elem);
|
unsigned globalElemIdx = elemMapper.index(elem);
|
||||||
const auto& priVarsNew = ebosSimulator_.model().solution(/*timeIdx=*/0)[globalElemIdx];
|
const auto& priVarsNew = ebosSimulator_.model().solution(/*timeIdx=*/0)[globalElemIdx];
|
||||||
|
|
||||||
@ -667,14 +661,8 @@ namespace Opm {
|
|||||||
|
|
||||||
ElementContext elemCtx(ebosSimulator_);
|
ElementContext elemCtx(ebosSimulator_);
|
||||||
const auto& gridView = ebosSimulator().gridView();
|
const auto& gridView = ebosSimulator().gridView();
|
||||||
const auto& elemEndIt = gridView.template end</*codim=*/0, Dune::Interior_Partition>();
|
|
||||||
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, Dune::Interior_Partition>();
|
|
||||||
elemIt != elemEndIt;
|
|
||||||
++elemIt)
|
|
||||||
{
|
|
||||||
const auto& elem = *elemIt;
|
|
||||||
elemCtx.updatePrimaryStencil(elem);
|
elemCtx.updatePrimaryStencil(elem);
|
||||||
elemCtx.updatePrimaryIntensiveQuantities(/*timeIdx=*/0);
|
elemCtx.updatePrimaryIntensiveQuantities(/*timeIdx=*/0);
|
||||||
const unsigned cell_idx = elemCtx.globalSpaceIndex(/*spaceIdx=*/0, /*timeIdx=*/0);
|
const unsigned cell_idx = elemCtx.globalSpaceIndex(/*spaceIdx=*/0, /*timeIdx=*/0);
|
||||||
@ -803,7 +791,7 @@ namespace Opm {
|
|||||||
|
|
||||||
OPM_BEGIN_PARALLEL_TRY_CATCH();
|
OPM_BEGIN_PARALLEL_TRY_CATCH();
|
||||||
|
|
||||||
for (const auto& elem: elements(gridView, Dune::Partitions::interiorBorder))
|
for (const auto& elem : elements(gridView, Dune::Partitions::interiorBorder))
|
||||||
{
|
{
|
||||||
// Skip cells of numerical Aquifer
|
// Skip cells of numerical Aquifer
|
||||||
if (isNumericalAquiferCell(gridView.grid(), elem))
|
if (isNumericalAquiferCell(gridView.grid(), elem))
|
||||||
|
Loading…
Reference in New Issue
Block a user