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

[privarswitch] Throw not implemented error until implemented. See #432.

parent 88e0a6a1
No related branches found
No related tags found
1 merge request!725Fix/compiler errors and warnings clang
......@@ -124,58 +124,61 @@ public:
problem, fvGridGeometry);
Dune::Hybrid::ifElse(std::integral_constant<bool, GET_PROP_VALUE(TypeTag, EnableGridVolumeVariablesCache)>(),
[&](auto IF) {
std::cout << "blub";
// update the secondary variables if global caching is enabled
// \note we only updated if phase presence changed as the volume variables
// are already updated once by the switch
for (const auto& element : elements(fvGridGeometry.gridView()))
{
// make sure FVElementGeometry & vol vars are bound to the element
auto fvGeometry = localView(fvGridGeometry);
fvGeometry.bindElement(element);
if (switchedInLastIteration_)
{
for (auto&& scv : scvs(fvGeometry))
{
const auto dofIdxGlobal = scv.dofIndex();
if (priVarSwitch_->wasSwitched(dofIdxGlobal))
{
const auto eIdx = fvGridGeometry.elementMapper().index(element);
const ElementSolution elemSol(element, this->curSol(), fvGridGeometry);
this->nonConstCurGridVolVars().volVars(eIdx, scv.indexInElement()).update(elemSol,
problem,
element,
scv);
}
}
}
// handle the boundary volume variables for cell-centered models
if(!isBox)
{
for (auto&& scvf : scvfs(fvGeometry))
{
// if we are not on a boundary, skip the rest
if (!scvf.boundary())
continue;
// check if boundary is a pure dirichlet boundary
const auto bcTypes = problem.boundaryTypes(element, scvf);
if (bcTypes.hasOnlyDirichlet())
{
const auto insideScvIdx = scvf.insideScvIdx();
const auto& insideScv = fvGeometry.scv(insideScvIdx);
const ElementSolution elemSol(problem.dirichlet(element, scvf));
this->nonConstCurGridVolVars().volVars(scvf.outsideScvIdx(), 0/*indexInElement*/).update(elemSol, problem, element, insideScv);
}
}
}
}
[&](auto&& _if)
{
DUNE_THROW(Dune::NotImplemented, "Privar switch and volume varaible caching! Please implement!");
// TODO:
// std::cout << "blub";
//
// // update the secondary variables if global caching is enabled
// // \note we only updated if phase presence changed as the volume variables
// // are already updated once by the switch
// for (const auto& element : elements(fvGridGeometry.gridView()))
// {
// // make sure FVElementGeometry & vol vars are bound to the element
// auto fvGeometry = localView(fvGridGeometry);
// fvGeometry.bindElement(element);
//
// if (switchedInLastIteration_)
// {
// for (auto&& scv : scvs(fvGeometry))
// {
// const auto dofIdxGlobal = scv.dofIndex();
// if (priVarSwitch_->wasSwitched(dofIdxGlobal))
// {
// const auto eIdx = fvGridGeometry.elementMapper().index(element);
// const ElementSolution elemSol(element, this->curSol(), fvGridGeometry);
// this->nonConstCurGridVolVars().volVars(eIdx, scv.indexInElement()).update(elemSol,
// problem,
// element,
// scv);
// }
// }
// }
//
// // handle the boundary volume variables for cell-centered models
// if(!isBox)
// {
// for (auto&& scvf : scvfs(fvGeometry))
// {
// // if we are not on a boundary, skip the rest
// if (!scvf.boundary())
// continue;
//
// // check if boundary is a pure dirichlet boundary
// const auto bcTypes = problem.boundaryTypes(element, scvf);
// if (bcTypes.hasOnlyDirichlet())
// {
// const auto insideScvIdx = scvf.insideScvIdx();
// const auto& insideScv = fvGeometry.scv(insideScvIdx);
// const ElementSolution elemSol(problem.dirichlet(element, scvf));
//
// this->nonConstCurGridVolVars().volVars(scvf.outsideScvIdx(), 0/*indexInElement*/).update(elemSol, 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