Skip to content
Snippets Groups Projects
Commit 7225af9d authored by Kilian Weishaupt's avatar Kilian Weishaupt Committed by Timo Koch
Browse files

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

[md][box] Internal Dirichlet

See merge request !2637

(cherry picked from commit dce216a4)

f2e2f221 [md][box] Internal Dirichlet
parent a3028ab0
Branches 1094-search-and-remove-deprecated-stuff
No related tags found
1 merge request!2638Merge branch 'feature/box-multidomain-internal-dirichlet' into 'master'
Pipeline #4345 passed
+1
...@@ -221,10 +221,10 @@ public: ...@@ -221,10 +221,10 @@ public:
// and set the residual to (privar - dirichletvalue) // and set the residual to (privar - dirichletvalue)
for (const auto& scvI : scvs(this->fvGeometry())) 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()) 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 // set the Dirichlet conditions in residual and jacobian
for (int eqIdx = 0; eqIdx < internalDirichletConstraints.size(); ++eqIdx) for (int eqIdx = 0; eqIdx < internalDirichletConstraints.size(); ++eqIdx)
if (internalDirichletConstraints[eqIdx]) if (internalDirichletConstraints[eqIdx])
......
...@@ -388,6 +388,7 @@ class SubDomainBoxLocalAssembler<id, TypeTag, Assembler, DiffMethod::numeric, /* ...@@ -388,6 +388,7 @@ class SubDomainBoxLocalAssembler<id, TypeTag, Assembler, DiffMethod::numeric, /*
using FVElementGeometry = typename GridGeometry::LocalView; using FVElementGeometry = typename GridGeometry::LocalView;
using GridView = typename GridGeometry::GridView; using GridView = typename GridGeometry::GridView;
using Element = typename GridView::template Codim<0>::Entity; using Element = typename GridView::template Codim<0>::Entity;
using Problem = GetPropType<TypeTag, Properties::Problem>;
enum { numEq = GetPropType<TypeTag, Properties::ModelTraits>::numEq() }; enum { numEq = GetPropType<TypeTag, Properties::ModelTraits>::numEq() };
enum { dim = GridView::dimension }; enum { dim = GridView::dimension };
...@@ -581,6 +582,15 @@ public: ...@@ -581,6 +582,15 @@ public:
A[scv.dofIndex()][globalJ][eqIdx][pvIdx] = 0.0; A[scv.dofIndex()][globalJ][eqIdx][pvIdx] = 0.0;
else else
A[scv.dofIndex()][globalJ][eqIdx][pvIdx] += partialDerivs[scv.localDofIndex()][eqIdx]; 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