14#ifndef DUMUX_DISCRETIZATION_FE_ELEMENT_DISCRETIZATION_HH
15#define DUMUX_DISCRETIZATION_FE_ELEMENT_DISCRETIZATION_HH
21#include <dune/common/rangeutilities.hh>
22#include <dune/geometry/type.hh>
39template<
class GG,
bool enableGr
idDiscretizationCache>
42 using GridView =
typename GG::GridView;
45 using FeLocalBasis =
typename GG::FeCache::FiniteElementType::Traits::LocalBasisType;
46 using GGCache =
typename GG::Cache;
47 using DofHelper =
typename GGCache::DofHelper;
51 using Element =
typename GridView::template Codim<0>::Entity;
54 using GridGeometry [[deprecated(
"Use GridDiscretization instead")]] = GG;
73 {
return DofHelper::localDofs(elemDisc); }
82 {
return DofHelper::localDofsOnBoundaryFace(elemDisc,
boundaryFace); }
86 friend inline std::ranges::view
auto
89 const auto& v = elemDisc.ggCache_->boundaryFaces(elemDisc.eIdx_);
90 return std::ranges::views::all(v);
113 return std::move(*
this);
129 return std::move(*
this);
137 elementGeometry_.emplace(
element.geometry());
142 {
return static_cast<bool>(element_); }
146 {
return *element_; }
150 {
return *elementGeometry_; }
153 [[deprecated(
"Use gridDiscretization() instead")]]
155 {
return ggCache_->gridDiscretization(); }
159 {
return ggCache_->gridDiscretization(); }
163 {
return !ggCache_->boundaryFaces(eIdx_).empty(); }
167 {
return ggCache_->boundaryFaces(eIdx_)[bfIdx]; }
179 typename BoundaryFace::Traits::CornerStorage corners;
180 for (
int i = 0; i < faceGeoInRef.corners(); ++i)
181 corners.push_back(elemGeo.global(faceGeoInRef.corner(i)));
182 return { faceGeoInRef.type(), corners };
186 template<
class LocalDof>
189 const auto type = elemDisc.
element().type();
191 const auto& localPos = DofHelper::localDofPosition(type, localKey);
201 const typename Element::Geometry::GlobalCoordinate& globalPos)
204 [&] (
const typename Element::Geometry::GlobalCoordinate& pos) {
211 const GGCache* ggCache_;
214 std::optional<Element> element_;
215 std::optional<typename Element::Geometry> elementGeometry_;
An interpolation point related to a global position of an element, giving its local positions by a ma...
Definition cvfe/interpolationpointdata.hh:82
An interpolation point related to a localDof of an element, giving its global and local positions.
Definition cvfe/interpolationpointdata.hh:60
const auto & feLocalCoefficients() const
Get the local finite element coefficients.
Definition feelementdiscretization.hh:98
typename GG::BoundaryFaceQuadratureRule BoundaryFaceQuadratureRule
the quadrature rule type for boundary faces
Definition feelementdiscretization.hh:60
friend auto ipData(const FEElementDiscretization &elemDisc, const LocalDof &localDof)
Interpolation point data for a localDof.
Definition feelementdiscretization.hh:187
std::size_t numLocalDofs() const
The total number of element-local dofs.
Definition feelementdiscretization.hh:102
static constexpr std::size_t maxNumElementDofs
Definition feelementdiscretization.hh:64
const GridDiscretization & gridGeometry() const
The grid geometry we are a restriction of (deprecated).
Definition feelementdiscretization.hh:154
friend auto localDofs(const FEElementDiscretization &elemDisc)
iterate over all local dofs
Definition feelementdiscretization.hh:72
FEElementDiscretization(const GGCache &ggCache)
Constructor.
Definition feelementdiscretization.hh:67
typename GG::BoundaryFace BoundaryFace
export the boundary face type
Definition feelementdiscretization.hh:62
const Element & element() const
Definition feelementdiscretization.hh:145
FEElementDiscretization bindElement(const Element &element) &&
bind the local view (r-value overload) This overload is called when an instance of this class is a te...
Definition feelementdiscretization.hh:126
friend auto ipData(const FEElementDiscretization &elemDisc, const typename Element::Geometry::GlobalCoordinate &globalPos)
Interpolation point data for a global position.
Definition feelementdiscretization.hh:200
typename GG::ElementQuadratureRule ElementQuadratureRule
the quadrature rule type for elements
Definition feelementdiscretization.hh:56
const Element::Geometry & elementGeometry() const
The bound element geometry.
Definition feelementdiscretization.hh:149
FEElementDiscretization bind(const Element &element) &&
bind the local view (r-value overload) This overload is called when an instance of this class is a te...
Definition feelementdiscretization.hh:110
bool isBound() const
Returns true if bind/bindElement has already been called.
Definition feelementdiscretization.hh:141
void bind(const Element &element) &
Definition feelementdiscretization.hh:118
GG GridDiscretization
export type of finite element grid discretization
Definition feelementdiscretization.hh:53
friend auto localDofs(const FEElementDiscretization &elemDisc, const BoundaryFace &boundaryFace)
Definition feelementdiscretization.hh:81
friend std::ranges::view auto boundaryFaces(const FEElementDiscretization &elemDisc)
Definition feelementdiscretization.hh:87
const BoundaryFace & boundaryFace(LocalIndexType bfIdx) const
Definition feelementdiscretization.hh:166
const FeLocalBasis & feLocalBasis() const
Get a local finite element basis.
Definition feelementdiscretization.hh:94
std::size_t elementIndex() const
The bound element index.
Definition feelementdiscretization.hh:170
friend auto nonCVLocalDofs(const FEElementDiscretization &elemDisc)
iterate over non-CV local dofs (for pure FE methods all dofs are non-CV)
Definition feelementdiscretization.hh:76
typename GridView::template Codim< 0 >::Entity Element
export the element type
Definition feelementdiscretization.hh:51
typename GG::IntersectionQuadratureRule IntersectionQuadratureRule
the quadrature rule type for intersections
Definition feelementdiscretization.hh:58
bool hasBoundaryFaces() const
Returns whether the element has boundary faces.
Definition feelementdiscretization.hh:162
BoundaryFace::Traits::Geometry geometry(const BoundaryFace &boundaryFace) const
Geometry of a boundary face.
Definition feelementdiscretization.hh:174
const GridDiscretization & gridDiscretization() const
The grid discretization we are a restriction of.
Definition feelementdiscretization.hh:158
void bindElement(const Element &element) &
Binding of an element, has to be called before using the fe geometries.
Definition feelementdiscretization.hh:133
Classes representing interpolation point data for control-volume finite element schemes.
Class representing dofs on elements for control-volume finite element schemes.
Definition assembly/assembler.hh:44
Quadrature rules over sub-control volumes and sub-control volume faces.
typename GridView::IndexSet::IndexType GridIndex
Definition indextraits.hh:27
unsigned int LocalIndex
Definition indextraits.hh:28