mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
PffGridvector: use elements range generator
This commit is contained in:
parent
6d747b6620
commit
a8bbe5549c
@ -71,11 +71,8 @@ public:
|
|||||||
// whole grid and update a stencil for each element
|
// whole grid and update a stencil for each element
|
||||||
Data *curElemDataPtr = &data_[0];
|
Data *curElemDataPtr = &data_[0];
|
||||||
Stencil stencil(gridView_, dofMapper_);
|
Stencil stencil(gridView_, dofMapper_);
|
||||||
auto elemIt = gridView_.template begin</*codim=*/0>();
|
for (const auto& elem : elements(gridView_)) {
|
||||||
const auto& elemEndIt = gridView_.template end</*codim=*/0>();
|
|
||||||
for (; elemIt != elemEndIt; ++elemIt) {
|
|
||||||
// set the DOF data pointer for the current element
|
// set the DOF data pointer for the current element
|
||||||
const auto& elem = *elemIt;
|
|
||||||
unsigned elemIdx = elementMapper_.index(elem);
|
unsigned elemIdx = elementMapper_.index(elem);
|
||||||
elemData_[elemIdx] = curElemDataPtr;
|
elemData_[elemIdx] = curElemDataPtr;
|
||||||
|
|
||||||
@ -112,10 +109,8 @@ private:
|
|||||||
|
|
||||||
// loop over the whole grid and sum up the number of local DOFs of all Stencils
|
// loop over the whole grid and sum up the number of local DOFs of all Stencils
|
||||||
Stencil stencil(gridView_, dofMapper_);
|
Stencil stencil(gridView_, dofMapper_);
|
||||||
auto elemIt = gridView_.template begin</*codim=*/0>();
|
for (const auto& elem : elements(gridView_)) {
|
||||||
const auto& elemEndIt = gridView_.template end</*codim=*/0>();
|
stencil.update(elem);
|
||||||
for (; elemIt != elemEndIt; ++elemIt) {
|
|
||||||
stencil.update(*elemIt);
|
|
||||||
result += stencil.numDof();
|
result += stencil.numDof();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user