Skip to content
Snippets Groups Projects
Commit dce216a4 authored by Kilian Weishaupt's avatar Kilian Weishaupt
Browse files

Merge branch 'feature/box-multidomain-internal-dirichlet' into 'master'

[md][box] Internal Dirichlet

See merge request !2637
parents 9779114b f2e2f221
No related branches found
No related tags found
1 merge request!2637[md][box] Internal Dirichlet
Pipeline #4335 passed with stages
in 0 seconds
......@@ -221,10 +221,10 @@ public:
// and set the residual to (privar - dirichletvalue)
for (const auto& scvI : scvs(this->fvGeometry()))
{
const auto internalDirichletConstraints = this->problem().hasInternalDirichletConstraint(this->element(), scvI);
const auto internalDirichletConstraints = asImp_().problem().hasInternalDirichletConstraint(this->element(), scvI);
if (internalDirichletConstraints.any())
{
const auto dirichletValues = this->problem().internalDirichlet(this->element(), scvI);
const auto dirichletValues = asImp_().problem().internalDirichlet(this->element(), scvI);
// set the Dirichlet conditions in residual and jacobian
for (int eqIdx = 0; eqIdx < internalDirichletConstraints.size(); ++eqIdx)
if (internalDirichletConstraints[eqIdx])
......
......@@ -388,6 +388,7 @@ class SubDomainBoxLocalAssembler<id, TypeTag, Assembler, DiffMethod::numeric, /*
using FVElementGeometry = typename GridGeometry::LocalView;
using GridView = typename GridGeometry::GridView;
using Element = typename GridView::template Codim<0>::Entity;
using Problem = GetPropType<TypeTag, Properties::Problem>;
enum { numEq = GetPropType<TypeTag, Properties::ModelTraits>::numEq() };
enum { dim = GridView::dimension };
......@@ -581,6 +582,15 @@ public:
A[scv.dofIndex()][globalJ][eqIdx][pvIdx] = 0.0;
else
A[scv.dofIndex()][globalJ][eqIdx][pvIdx] += partialDerivs[scv.localDofIndex()][eqIdx];
// enforce internal Dirichlet constraints
if constexpr (Problem::enableInternalDirichletConstraints())
{
const auto internalDirichletConstraints = this->problem().hasInternalDirichletConstraint(this->element(), scv);
if (internalDirichletConstraints[eqIdx])
A[scv.dofIndex()][globalJ][eqIdx][pvIdx] = 0.0;
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment