diff --git a/dumux/implicit/cellcentered/ccelementvolumevariables.hh b/dumux/implicit/cellcentered/ccelementvolumevariables.hh index c4ef73458254278381041c567fd69f51c5219eb9..b2a5b09e1a88aef254e9d734ab09350bb04d9da3 100644 --- a/dumux/implicit/cellcentered/ccelementvolumevariables.hh +++ b/dumux/implicit/cellcentered/ccelementvolumevariables.hh @@ -104,14 +104,16 @@ public: // only treat boundary if current solution is evaluated if (!oldSol) { - // check if element intersects with a Dirichlet boundary + // check if element intersects with the boundary ElementBoundaryTypes elemBCTypes; elemBCTypes.update(problem, element); - if (elemBCTypes.hasDirichlet()) + if (elemBCTypes.hasDirichlet() + || elemBCTypes.hasNeumann() + || elemBCTypes.hasOutflow()) { this->resize(numNeighbors + element.template count<1>()); - // add volume variables for the Dirichlet faces + // add volume variables for the boundary faces IntersectionIterator isIt = problem.gridView().ibegin(element); IntersectionIterator isEndIt = problem.gridView().iend(element); for (; isIt != isEndIt; ++isIt) { @@ -121,13 +123,14 @@ public: BoundaryTypes bcTypes; problem.boundaryTypes(bcTypes, *isIt); + int faceIdx = isIt->indexInInside(); + int indexInVariables = numNeighbors + faceIdx; + if (bcTypes.hasDirichlet()) { PrimaryVariables dirichletValues; problem.dirichlet(dirichletValues, *isIt); - int faceIdx = isIt->indexInInside(); - int indexInVariables = numNeighbors + faceIdx; (*this)[indexInVariables].update(dirichletValues, problem, element, @@ -135,6 +138,10 @@ public: /*scvIdx=*/0, oldSol); } + else + { + (*this)[indexInVariables] = (*this)[0]; + } } } }