24#ifndef DUMUX_CVFE_ELEMENT_BOUNDARY_TYPES_HH
25#define DUMUX_CVFE_ELEMENT_BOUNDARY_TYPES_HH
52 template<
class Problem,
class FVElementGeometry>
54 const typename FVElementGeometry::Element& element,
55 const FVElementGeometry& fvGeometry)
57 using GridGeometry =
typename FVElementGeometry::GridGeometry;
60 if (!fvGeometry.hasBoundaryScvf())
63 bcTypes_.resize(fvGeometry.numScv());
65 hasDirichlet_ =
false;
71 for (
const auto& scvf : scvfs(fvGeometry))
75 const auto localIndex = fvGeometry.scv(scvf.insideScvIdx()).localDofIndex();
76 bcTypes_[localIndex] = problem.boundaryTypes(element, scvf);
77 hasDirichlet_ = hasDirichlet_ || bcTypes_[localIndex].hasDirichlet();
78 hasNeumann_ = hasNeumann_ || bcTypes_[localIndex].hasNeumann();
87 for (
const auto& scv : scvs(fvGeometry))
89 const auto scvIdxLocal = scv.localDofIndex();
90 bcTypes_[scvIdxLocal].reset();
92 if (fvGeometry.gridGeometry().dofOnBoundary(scv.dofIndex()))
94 bcTypes_[scvIdxLocal] = problem.boundaryTypes(element, scv);
95 hasDirichlet_ = hasDirichlet_ || bcTypes_[scvIdxLocal].hasDirichlet();
96 hasNeumann_ = hasNeumann_ || bcTypes_[scvIdxLocal].hasNeumann();
107 {
return hasDirichlet_; }
114 {
return hasNeumann_; }
120 [[deprecated(
"This operator is deprecated use get function")]]
123 assert(i < bcTypes_.size());
132 template<
class FVElementGeometry>
133 const BoundaryTypes&
get(
const FVElementGeometry& fvGeometry,
const typename FVElementGeometry::SubControlVolumeFace& scvf)
const
135 assert(scvf.boundary());
136 const auto localDofIdx = fvGeometry.scv(scvf.insideScvIdx()).localDofIndex();
137 assert(localDofIdx < bcTypes_.size());
138 return bcTypes_[localDofIdx];
146 template<
class FVElementGeometry>
147 const BoundaryTypes&
get(
const FVElementGeometry&,
const typename FVElementGeometry::SubControlVolume& scv)
const
149 const auto localDofIdx = scv.localDofIndex();
150 assert(localDofIdx < bcTypes_.size());
151 return bcTypes_[localDofIdx];
155 std::vector<BoundaryTypes> bcTypes_;
156 bool hasDirichlet_ =
false;
157 bool hasNeumann_ =
false;
The available discretization methods in Dumux.
Adaption of the non-isothermal two-phase two-component flow model to problems with CO2.
Definition: adapt.hh:29
constexpr FCDiamond fcdiamond
Definition: method.hh:141
This class stores an array of BoundaryTypes objects.
Definition: cvfe/elementboundarytypes.hh:40
BTypes BoundaryTypes
Definition: cvfe/elementboundarytypes.hh:42
const BoundaryTypes & operator[](std::size_t i) const
Definition: cvfe/elementboundarytypes.hh:121
bool hasDirichlet() const
Returns whether the element has a vertex which contains a Dirichlet value.
Definition: cvfe/elementboundarytypes.hh:106
const BoundaryTypes & get(const FVElementGeometry &, const typename FVElementGeometry::SubControlVolume &scv) const
Definition: cvfe/elementboundarytypes.hh:147
bool hasNeumann() const
Returns whether the element potentially features a Neumann boundary segment.
Definition: cvfe/elementboundarytypes.hh:113
const BoundaryTypes & get(const FVElementGeometry &fvGeometry, const typename FVElementGeometry::SubControlVolumeFace &scvf) const
Definition: cvfe/elementboundarytypes.hh:133
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:53