diff --git a/dumux/discretization/facecentered/staggered/elementvolumevariables.hh b/dumux/discretization/facecentered/staggered/elementvolumevariables.hh index 8a349bfb2200073945870882153fbd61b81dc757..0a12cf6380d0585427bd0f4521c71cb72d89de2a 100644 --- a/dumux/discretization/facecentered/staggered/elementvolumevariables.hh +++ b/dumux/discretization/facecentered/staggered/elementvolumevariables.hh @@ -96,8 +96,9 @@ public: return; clear_(); - boundaryVolVarIndices_.reserve(fvGeometry.gridGeometry().numBoundaryScv()); - boundaryVolumeVariables_.reserve(fvGeometry.gridGeometry().numBoundaryScv()); + // upper bound of size is the number of all scvfs minus frontal scvfs + boundaryVolVarIndices_.reserve(fvGeometry.numScvf()-element.subEntities(1)); + boundaryVolumeVariables_.reserve(fvGeometry.numScvf()-element.subEntities(1)); for (const auto& scvf : scvfs(fvGeometry)) {