fix incrementer in boundarycontext

This commit is contained in:
Tor Harald Sandve 2021-01-13 13:01:41 +01:00
parent 732931d952
commit 1b4f0cf2c5
2 changed files with 12 additions and 2 deletions

View File

@ -77,8 +77,15 @@ public:
void increment()
{
const auto& iend = gridView().iend(element());
while (intersectionIt_ != iend && !intersectionIt_->boundary())
++ intersectionIt_;
if(intersectionIt_ == iend)
return;
++intersectionIt_;
// iterate to the next boundary intersection
while (intersectionIt_ != iend && !intersectionIt_->boundary()) {
++intersectionIt_;
}
}
/*!

View File

@ -425,6 +425,9 @@ protected:
return;
BoundaryContext boundaryCtx(elemCtx);
// move the iterator to the first boundary
if(!boundaryCtx.intersection(0).boundary())
boundaryCtx.increment();
// evaluate the boundary for all boundary faces of the current context
size_t numBoundaryFaces = boundaryCtx.numBoundaryFaces(/*timeIdx=*/0);