12#ifndef DUMUX_CVFE_ELEMENT_BOUNDARY_TYPES_HH
13#define DUMUX_CVFE_ELEMENT_BOUNDARY_TYPES_HH
41 template<
class Problem,
class FVElementGeometry>
43 const typename FVElementGeometry::Element& element,
44 const FVElementGeometry& fvGeometry)
46 bcTypes_.resize(fvGeometry.numScv());
48 hasDirichlet_ =
false;
51 const auto& gridDiscretization = Deprecated::gridGeometry(fvGeometry);
53 for (
const auto& scv :
scvs(fvGeometry))
55 const auto scvIdxLocal = scv.localDofIndex();
56 bcTypes_[scvIdxLocal].reset();
58 if (gridDiscretization.dofOnBoundary(scv.dofIndex()))
60 bcTypes_[scvIdxLocal] = problem.boundaryTypes(element, scv);
61 hasDirichlet_ = hasDirichlet_ || bcTypes_[scvIdxLocal].hasDirichlet();
62 hasNeumann_ = hasNeumann_ || bcTypes_[scvIdxLocal].hasNeumann();
72 {
return hasDirichlet_; }
79 {
return hasNeumann_; }
86 template<
class FVElementGeometry>
87 const BoundaryTypes&
get(
const FVElementGeometry& fvGeometry,
const typename FVElementGeometry::SubControlVolumeFace& scvf)
const
89 assert(scvf.boundary());
90 const auto localDofIdx = fvGeometry.scv(scvf.insideScvIdx()).localDofIndex();
91 assert(localDofIdx < bcTypes_.size());
92 return bcTypes_[localDofIdx];
100 template<
class FVElementGeometry>
101 const BoundaryTypes&
get(
const FVElementGeometry&,
const typename FVElementGeometry::SubControlVolume& scv)
const
103 const auto localDofIdx = scv.localDofIndex();
104 assert(localDofIdx < bcTypes_.size());
105 return bcTypes_[localDofIdx];
109 std::vector<BoundaryTypes> bcTypes_;
110 bool hasDirichlet_ =
false;
111 bool hasNeumann_ =
false;
This class stores an array of BoundaryTypes objects.
Definition cvfe/elementboundarytypes.hh:29
BTypes BoundaryTypes
Definition cvfe/elementboundarytypes.hh:31
bool hasDirichlet() const
Returns whether the element has a vertex which contains a Dirichlet value.
Definition cvfe/elementboundarytypes.hh:71
const BoundaryTypes & get(const FVElementGeometry &, const typename FVElementGeometry::SubControlVolume &scv) const
Definition cvfe/elementboundarytypes.hh:101
bool hasNeumann() const
Returns whether the element potentially features a Neumann boundary segment.
Definition cvfe/elementboundarytypes.hh:78
const BoundaryTypes & get(const FVElementGeometry &fvGeometry, const typename FVElementGeometry::SubControlVolumeFace &scvf) const
Definition cvfe/elementboundarytypes.hh:87
void update(const Problem &problem, const typename FVElementGeometry::Element &element, const FVElementGeometry &fvGeometry)
Update the boundary types for all vertices of an element.
Definition cvfe/elementboundarytypes.hh:42
The available discretization methods in Dumux.
std::ranges::range auto scvs(const FVElementGeometry &fvGeometry, const LocalDof &localDof)
Definition localdof.hh:82