diff --git a/dumux/discretization/cellcentered/mpfa/omethod/localassembler.hh b/dumux/discretization/cellcentered/mpfa/omethod/localassembler.hh index 50116c73c6426a33c0309c797891c1dc7c801144..7cb4fa1b2e099d7da53f608782919e51bd052782 100644 --- a/dumux/discretization/cellcentered/mpfa/omethod/localassembler.hh +++ b/dumux/discretization/cellcentered/mpfa/omethod/localassembler.hh @@ -591,7 +591,7 @@ public: const auto& wijk = iv.omegas()[localScvfIdx][idxInOutside+1]; // make sure the given outside gravity container has the right size - assert(outsideG[pIdx][localScvfIdx].size() == iv.localScvf(localScvfIdx).neighboringLocalScvIndices().size()); + assert(outsideG[pIdx][localScvfIdx].size() == iv.localScvf(localScvfIdx).neighboringLocalScvIndices().size()-1); // add contributions from all local directions for (LocalIndexType localDir = 0; localDir < IV::Traits::GridView::dimension; localDir++) diff --git a/dumux/porousmediumflow/1p/incompressiblelocalresidual.hh b/dumux/porousmediumflow/1p/incompressiblelocalresidual.hh index 9db8fc856c3bf5cb4035128c2594b6ce5bfb0cc6..6d7e394c0199d18adc179ba2b4479c3ffbf7dfb1 100644 --- a/dumux/porousmediumflow/1p/incompressiblelocalresidual.hh +++ b/dumux/porousmediumflow/1p/incompressiblelocalresidual.hh @@ -130,7 +130,10 @@ public: if (fluxVarsCache.usesSecondaryIv()) { const auto& tij = fluxVarsCache.advectionTijSecondaryIv(); - assert(stencil.size() == tij.size()); + + // We assume same the tij are order as the stencil up to stencil.size() + // any contribution of Dirichlet BCs is assumed to be placed afterwards + assert(stencil.size() <= tij.size()); // add partial derivatives to the respective given matrices for (unsigned int i = 0; i < stencil.size();++i) @@ -144,7 +147,10 @@ public: else { const auto& tij = fluxVarsCache.advectionTijPrimaryIv(); - assert(stencil.size() == tij.size()); + + // We assume same the tij are order as the stencil up to stencil.size() + // any contribution of Dirichlet BCs is assumed to be placed afterwards + assert(stencil.size() <= tij.size()); // add partial derivatives to the respective given matrices for (unsigned int i = 0; i < stencil.size();++i)