12#ifndef DUMUX_ELEMENT_BOUNDARY_TYPES_HH
13#define DUMUX_ELEMENT_BOUNDARY_TYPES_HH
18#include <dune/geometry/referenceelements.hh>
42 template<
class Problem,
class FVElementGeometry>
44 const typename FVElementGeometry::Element& element,
45 const FVElementGeometry& fvGeometry)
47 static constexpr int dim = FVElementGeometry::GridGeometry::GridView::dimension;
48 using Scalar =
typename FVElementGeometry::GridGeometry::GlobalCoordinate::value_type;
50 bcTypes_.resize(Dune::referenceElement<Scalar, dim>(element.type()).size(dim-1));
52 hasFluxBoundary_ =
false;
54 for (
const auto& boundaryFace : boundaryFaces(fvGeometry))
56 const auto localIdx = boundaryFace.intersectionIndex();
57 bcTypes_[localIdx].reset();
59 bcTypes_[localIdx] = problem.boundaryTypes(fvGeometry, boundaryFace);
60 hasFluxBoundary_ = hasFluxBoundary_ || bcTypes_[localIdx].hasFluxBoundary();
69 {
return hasFluxBoundary_; }
76 template<
class FVElementGeometry>
77 const BoundaryTypes&
get(
const FVElementGeometry& fvGeometry,
const typename FVElementGeometry::SubControlVolumeFace& scvf)
const
79 assert(scvf.boundary());
80 const auto localIdx = fvGeometry.intersectionIndex(scvf);
81 assert(localIdx < bcTypes_.size());
82 return bcTypes_[localIdx];
89 template<
class FVElementGeometry>
90 const BoundaryTypes&
get(
const FVElementGeometry&,
const typename FVElementGeometry::BoundaryFace& boundaryFace)
const
92 const auto localIdx = boundaryFace.intersectionIndex();
93 assert(localIdx < bcTypes_.size());
94 return bcTypes_[localIdx];
98 std::vector<BoundaryTypes> bcTypes_;
99 bool hasFluxBoundary_ =
false;
This class stores an array of BoundaryTypes objects. This class is not dependent on the used discreti...
Definition: elementboundarytypes.hh:30
bool hasFluxBoundary() const
Returns whether the element potentially features a flux boundary segment.
Definition: elementboundarytypes.hh:68
const BoundaryTypes & get(const FVElementGeometry &, const typename FVElementGeometry::BoundaryFace &boundaryFace) const
Definition: elementboundarytypes.hh:90
BTypes BoundaryTypes
Definition: elementboundarytypes.hh:32
const BoundaryTypes & get(const FVElementGeometry &fvGeometry, const typename FVElementGeometry::SubControlVolumeFace &scvf) const
Definition: elementboundarytypes.hh:77
void update(const Problem &problem, const typename FVElementGeometry::Element &element, const FVElementGeometry &fvGeometry)
Update the boundary types for all element intersections.
Definition: elementboundarytypes.hh:43