diff --git a/opm/models/discretization/common/fvbaseboundarycontext.hh b/opm/models/discretization/common/fvbaseboundarycontext.hh index 9cce40d96..2b61518f4 100644 --- a/opm/models/discretization/common/fvbaseboundarycontext.hh +++ b/opm/models/discretization/common/fvbaseboundarycontext.hh @@ -83,7 +83,7 @@ public: ++intersectionIt_; // iterate to the next boundary intersection - while (intersectionIt_ != iend && !intersectionIt_->boundary()) { + while (intersectionIt_ != iend && intersectionIt_->neighbor()) { ++intersectionIt_; } } diff --git a/opm/models/discretization/common/fvbaselocalresidual.hh b/opm/models/discretization/common/fvbaselocalresidual.hh index cad090709..40f5d3ce4 100644 --- a/opm/models/discretization/common/fvbaselocalresidual.hh +++ b/opm/models/discretization/common/fvbaselocalresidual.hh @@ -426,7 +426,7 @@ protected: BoundaryContext boundaryCtx(elemCtx); // move the iterator to the first boundary - if(!boundaryCtx.intersection(0).boundary()) + if(boundaryCtx.intersection(0).neighbor()) boundaryCtx.increment(); // evaluate the boundary for all boundary faces of the current context @@ -434,6 +434,9 @@ protected: for (unsigned faceIdx = 0; faceIdx < numBoundaryFaces; ++faceIdx, boundaryCtx.increment()) { // add the residual of all vertices of the boundary // segment + if(!boundaryCtx.intersection(faceIdx).boundary()) + continue; + evalBoundarySegment_(residual, boundaryCtx, faceIdx,