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

[2p2c] Adapt to new volVar interface

parent 7ad36090
No related branches found
No related tags found
2 merge requests!617[WIP] Next,!537Fix/global volvar cache for box
...@@ -214,31 +214,35 @@ public: ...@@ -214,31 +214,35 @@ public:
auto dofIdxGlobal = scv.dofIndex(); auto dofIdxGlobal = scv.dofIndex();
if (priVarSwitch_().wasSwitched(dofIdxGlobal)) if (priVarSwitch_().wasSwitched(dofIdxGlobal))
{ {
const auto eIdx = this->problem_().elementMapper().index(element);
const auto elemSol = this->elementSolution(element, this->curSol()); const auto elemSol = this->elementSolution(element, this->curSol());
this->nonConstCurGlobalVolVars().volVars(scv).update(elemSol, this->nonConstCurGlobalVolVars().volVars(eIdx, scv.indexInElement()).update(elemSol,
this->problem_(), this->problem_(),
element, element,
scv); scv);
} }
} }
} }
// handle the boundary volume variables // handle the boundary volume variables for cell-centered models
for (auto&& scvf : scvfs(fvGeometry)) if(!isBox)
{ {
// if we are not on a boundary, skip the rest for (auto&& scvf : scvfs(fvGeometry))
if (!scvf.boundary())
continue;
// check if boundary is a pure dirichlet boundary
const auto bcTypes = this->problem_().boundaryTypes(element, scvf);
if (bcTypes.hasOnlyDirichlet())
{ {
const auto insideScvIdx = scvf.insideScvIdx(); // if we are not on a boundary, skip the rest
const auto& insideScv = fvGeometry.scv(insideScvIdx); if (!scvf.boundary())
const auto elemSol = ElementSolutionVector{this->problem_().dirichlet(element, scvf)}; continue;
// check if boundary is a pure dirichlet boundary
const auto bcTypes = this->problem_().boundaryTypes(element, scvf);
if (bcTypes.hasOnlyDirichlet())
{
const auto insideScvIdx = scvf.insideScvIdx();
const auto& insideScv = fvGeometry.scv(insideScvIdx);
const auto elemSol = ElementSolutionVector{this->problem_().dirichlet(element, scvf)};
this->nonConstCurGlobalVolVars().volVars(scvf.outsideScvIdx()).update(elemSol, this->problem_(), element, insideScv); this->nonConstCurGlobalVolVars().volVars(scvf.outsideScvIdx(), 0/*indexInElement*/).update(elemSol, this->problem_(), element, insideScv);
}
} }
} }
} }
......
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