Skip to content
Snippets Groups Projects
Commit 569ca6e7 authored by Timo Koch's avatar Timo Koch
Browse files

Merge branch 'fix/boxassembly-dirichlet' into 'master'

[boxlocalAssembler] Fix Dirichlet BCs for explicit assembly

Closes #702

See merge request !1598
parents fadf26d5 c0c855cc
No related branches found
No related tags found
1 merge request!1598[boxlocalAssembler] Fix Dirichlet BCs for explicit assembly
......@@ -131,12 +131,12 @@ public:
const auto pvIdx)
{
res[scvI.dofIndex()][eqIdx] = this->curElemVolVars()[scvI].priVars()[pvIdx] - dirichletValues[pvIdx];
for (const auto& scvJ : scvs(this->fvGeometry()))
{
jac[scvI.dofIndex()][scvJ.dofIndex()][eqIdx] = 0.0;
if (scvI.localDofIndex() == scvJ.localDofIndex())
jac[scvI.dofIndex()][scvI.dofIndex()][eqIdx][pvIdx] = 1.0;
}
auto& row = jac[scvI.dofIndex()];
for (auto col = row.begin(); col != row.end(); ++col)
row[col.index()][eqIdx] = 0.0;
jac[scvI.dofIndex()][scvI.dofIndex()][eqIdx][pvIdx] = 1.0;
// if a periodic dof has Dirichlet values also apply the same Dirichlet values to the other dof
if (this->assembler().fvGridGeometry().dofOnPeriodicBoundary(scvI.dofIndex()))
......@@ -166,12 +166,11 @@ public:
const auto eqIdx,
const auto pvIdx)
{
for (const auto& scvJ : scvs(this->fvGeometry()))
{
jac[scvI.dofIndex()][scvJ.dofIndex()][eqIdx] = 0.0;
if (scvI.localDofIndex() == scvJ.localDofIndex())
jac[scvI.dofIndex()][scvI.dofIndex()][eqIdx][pvIdx] = 1.0;
}
auto& row = jac[scvI.dofIndex()];
for (auto col = row.begin(); col != row.end(); ++col)
row[col.index()][eqIdx] = 0.0;
jac[scvI.dofIndex()][scvI.dofIndex()][eqIdx][pvIdx] = 1.0;
};
this->asImp_().evalDirichletBoundaries(applyDirichlet);
......
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