diff --git a/dumux/discretization/cellcentered/mpfa/elementvolumevariables.hh b/dumux/discretization/cellcentered/mpfa/elementvolumevariables.hh index 8dc18e813da59e936bb80cf5f7c8e866d22df51d..03e8db6eb02e8aa80267f096644c53874adf8b4b 100644 --- a/dumux/discretization/cellcentered/mpfa/elementvolumevariables.hh +++ b/dumux/discretization/cellcentered/mpfa/elementvolumevariables.hh @@ -24,6 +24,7 @@ #define DUMUX_DISCRETIZATION_CCMPFA_ELEMENT_VOLUMEVARIABLES_HH #include <dumux/implicit/properties.hh> +#include "facetypes.hh" namespace Dumux { @@ -171,16 +172,20 @@ public: if (!scvf.boundary()) continue; - // boundary volume variables - VolumeVariables dirichletVolVars; - const auto dirichletPriVars = problem.dirichlet(element, scvf); - dirichletVolVars.update(dirichletPriVars, problem, element, scvI); - volumeVariables_.emplace_back(std::move(dirichletVolVars)); - - // boundary vol var index - auto bVolVarIdx = scvf.outsideScvIdx(); - volVarIndices_.push_back(bVolVarIdx); - finishedBoundaries.push_back(bVolVarIdx); + // only proceed if we are on a dirichlet boundary + if (MpfaHelper::getMpfaFaceType(problem, element, scvf) == MpfaFaceTypes::dirichlet) + { + // boundary volume variables + VolumeVariables dirichletVolVars; + const auto dirichletPriVars = problem.dirichlet(element, scvf); + dirichletVolVars.update(dirichletPriVars, problem, element, scvI); + volumeVariables_.emplace_back(std::move(dirichletVolVars)); + + // boundary vol var index + auto bVolVarIdx = scvf.outsideScvIdx(); + volVarIndices_.push_back(bVolVarIdx); + finishedBoundaries.push_back(bVolVarIdx); + } } } @@ -202,19 +207,23 @@ public: // that means we are on a not yet handled boundary scvf auto insideScvIdx = ivScvf.insideScvIdx(); - auto&& ivScv = fvGeometry.scv(insideScvIdx); auto ivElement = globalFvGeometry.element(insideScvIdx); - // boundary volume variables - VolumeVariables dirichletVolVars; - const auto dirichletPriVars = problem.dirichlet(ivElement, ivScvf); - dirichletVolVars.update(dirichletPriVars, problem, ivElement, ivScv); - volumeVariables_.emplace_back(std::move(dirichletVolVars)); - - // boundary vol var index - auto bVolVarIdx = ivScvf.outsideScvIdx(); - volVarIndices_.push_back(bVolVarIdx); - finishedBoundaries.push_back(bVolVarIdx); + // only proceed if we are on a dirichlet boundary + if (MpfaHelper::getMpfaFaceType(problem, ivElement, ivScvf) == MpfaFaceTypes::dirichlet) + { + // boundary volume variables + VolumeVariables dirichletVolVars; + auto&& ivScv = fvGeometry.scv(insideScvIdx); + const auto dirichletPriVars = problem.dirichlet(ivElement, ivScvf); + dirichletVolVars.update(dirichletPriVars, problem, ivElement, ivScv); + volumeVariables_.emplace_back(std::move(dirichletVolVars)); + + // boundary vol var index + auto bVolVarIdx = ivScvf.outsideScvIdx(); + volVarIndices_.push_back(bVolVarIdx); + finishedBoundaries.push_back(bVolVarIdx); + } } }