RichardsLensProblem: use elements range generator

This commit is contained in:
Arne Morten Kvarving 2022-10-17 10:47:48 +02:00
parent ce8d626872
commit 8cd61e7240

View File

@ -247,10 +247,8 @@ public:
// determine which degrees of freedom are in the lens
Stencil stencil(this->gridView(), this->simulator().model().dofMapper() );
auto elemIt = this->gridView().template begin</*codim=*/0>();
auto elemEndIt = this->gridView().template end</*codim=*/0>();
for (; elemIt != elemEndIt; ++elemIt) {
stencil.update(*elemIt);
for (const auto& elem : elements(this->gridView())) {
stencil.update(elem);
for (unsigned dofIdx = 0; dofIdx < stencil.numPrimaryDof(); ++ dofIdx) {
unsigned globalDofIdx = stencil.globalSpaceIndex(dofIdx);
const auto& dofPos = stencil.subControlVolume(dofIdx).center();