Skip to content
Snippets Groups Projects
Commit fce10396 authored by Dennis Gläser's avatar Dennis Gläser Committed by Timo Koch
Browse files

[Implicit] Adjust CC and Box ElementBoundaryTypes to new structure

parent ab455103
No related branches found
No related tags found
1 merge request!617[WIP] Next
......@@ -75,9 +75,11 @@ public:
* \param problem The problem object which needs to be simulated
* \param element The DUNE Codim<0> entity for which the boundary
* types should be collected
* \param fvGeometry The element's finite volume geometry
*/
void update(const Problem &problem,
const Element &element)
const Element &element,
const FVElementGeometry &fvGeometry)
{
int numVertices = element.subEntities(dim);
......@@ -87,15 +89,18 @@ public:
hasNeumann_ = false;
hasOutflow_ = false;
for (int i = 0; i < numVertices; ++i) {
(*this)[i].reset();
for (auto&& scv : fvGeometry.scvs())
{
int scvIdxLocal = scv.indexInElement();
(*this)[scvIdxLocal].reset();
if (problem.model().onBoundary(element, i)) {
problem.boundaryTypes((*this)[i], element.template subEntity<dim>(i));
if (problem.model().onBoundary(scv))
{
(*this)[scvIdxLocal] = problem.boundaryTypes(element, scv);
hasDirichlet_ = hasDirichlet_ || (*this)[i].hasDirichlet();
hasNeumann_ = hasNeumann_ || (*this)[i].hasNeumann();
hasOutflow_ = hasOutflow_ || (*this)[i].hasOutflow();
hasDirichlet_ = hasDirichlet_ || (*this)[scvIdxLocal].hasDirichlet();
hasNeumann_ = hasNeumann_ || (*this)[scvIdxLocal].hasNeumann();
hasOutflow_ = hasOutflow_ || (*this)[scvIdxLocal].hasOutflow();
}
}
}
......@@ -106,12 +111,13 @@ public:
* \param problem The problem object which needs to be simulated
* \param element The DUNE Codim<0> entity for which the boundary
* types should be collected
* \param fvGeometry The element's finite volume geometry
*/
void update(const Problem &problem,
const Element &element,
const FVElementGeometry &fvGeometry)
{ update(problem, element); }
const Element &element)
{
const auto& fvGeometry = problem.model().fvGeometries(element);
update(problem, element, fvGeometry);
}
/*!
* \brief Returns whether the element has a vertex which contains
......
......@@ -76,7 +76,8 @@ public:
* types should be collected
*/
void update(const Problem &problem,
const Element &element)
const Element &element,
const FVElementGeometry &fvGeometry)
{
this->resize(1);
......@@ -86,26 +87,29 @@ public:
(*this)[0].reset();
if (problem.model().onBoundary(element))
for (auto&& scv : fvGeometry.scvs())
{
for (const auto& intersection : intersections(problem.gridView(), element))
if (!problem.model().onBoundary(scv))
return;
for (const auto&& scvFace : fvGeometry.scvfs())
{
if (intersection.boundary())
{
problem.boundaryTypes((*this)[0], intersection);
hasDirichlet_ = hasDirichlet_ || (*this)[0].hasDirichlet();
hasNeumann_ = hasNeumann_ || (*this)[0].hasNeumann();
hasOutflow_ = hasOutflow_ || (*this)[0].hasOutflow();
}
if (!scvFace.boundary())
continue;
(*this)[0] = problem.boundaryTypes(element, scvFace);
hasDirichlet_ = hasDirichlet_ || (*this)[0].hasDirichlet();
hasNeumann_ = hasNeumann_ || (*this)[0].hasNeumann();
hasOutflow_ = hasOutflow_ || (*this)[0].hasOutflow();
}
}
}
void update(const Problem &problem,
const Element &element,
const FVElementGeometry &fvGeometry)
const Element &element)
{
const auto& fvGeometry = problem.model().fvGeometries(element);
update(problem, element);
}
......
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