3#ifndef DUNE_GEOMETRY_REFERENCEELEMENT_HH
4#define DUNE_GEOMETRY_REFERENCEELEMENT_HH
14 template<
typename ctype,
int dim>
15 class ReferenceElementContainer;
20 template<
typename ctype,
int dim>
21 class ReferenceElementImplementation;
24 template<
typename ctype,
int dim>
25 struct ReferenceElements;
48 template<
typename Implementation>
58 using Codim =
typename Implementation::template Codim<codim>;
73 using ctype =
typename Implementation::ctype;
85 static constexpr int dimension = Implementation::dimension;
94 return _impl->size(c);
109 int size(
int i,
int c,
int cc)
const
111 return _impl->size(i,c,cc);
130 return _impl->subEntity(i,c,ii,cc);
153 return _impl->subEntities(i,c,cc);
169 decltype(
auto)
type(
int i,
int c)
const
171 return _impl->type(i,c);
184 return _impl->type();
203 return _impl->position(i,c);
216 return _impl->checkInside(local);
234 return _impl->template geometry<codim>(i);
241 return _impl->volume();
258 return _impl->integrationOuterNormal(face);
278 const Implementation&
impl()
const
286 return _impl == r._impl;
292 return not (*
this == r);
298 return reinterpret_cast<std::size_t
>(r._impl);
304 friend Implementation;
314 void setImplementation(
const Implementation&
impl)
319 const Implementation* _impl;
A unique label for each type of element that can occur in a grid.
unspecified-type ReferenceElement
Returns the type of reference element for the argument type T.
Definition: referenceelements.hh:495
Definition: affinegeometry.hh:19
This class provides access to geometric and topological properties of a reference element.
Definition: referenceelement.hh:25
CoordinateField volume() const
obtain the volume of the reference element
Definition: referenceelement.hh:239
ReferenceElement()
Constructs an empty reference element.
Definition: referenceelement.hh:269
bool operator!=(const ReferenceElement &r) const
Compares for inequality with another reference element.
Definition: referenceelement.hh:290
decltype(auto) type(int i, int c) const
obtain the type of subentity (i,c)
Definition: referenceelement.hh:169
typename Implementation::Coordinate Coordinate
The coordinate type.
Definition: referenceelement.hh:79
Codim< codim >::Geometry geometry(int i) const
obtain the embedding of subentity (i,codim) into the reference element
Definition: referenceelement.hh:232
static constexpr int dimension
The dimension of the reference element.
Definition: referenceelement.hh:85
int size(int i, int c, int cc) const
number of subentities of codimension cc of subentity (i,c)
Definition: referenceelement.hh:109
int subEntity(int i, int c, int ii, int cc) const
obtain number of ii-th subentity with codim cc of (i,c)
Definition: referenceelement.hh:128
typename Implementation::ctype ctype
The coordinate field type.
Definition: referenceelement.hh:73
int size(int c) const
number of subentities of codimension c
Definition: referenceelement.hh:92
decltype(auto) type() const
obtain the type of this reference element
Definition: referenceelement.hh:182
const Implementation & impl() const
Returns a reference to the internal implementation object.
Definition: referenceelement.hh:278
bool checkInside(const Coordinate &local) const
check if a coordinate is in the reference element
Definition: referenceelement.hh:214
ctype CoordinateField
The coordinate field type.
Definition: referenceelement.hh:76
bool operator==(const ReferenceElement &r) const
Compares for equality with another reference element.
Definition: referenceelement.hh:284
decltype(auto) position(int i, int c) const
position of the barycenter of entity (i,c)
Definition: referenceelement.hh:201
decltype(auto) integrationOuterNormal(int face) const
obtain the integration outer normal of the reference element
Definition: referenceelement.hh:256
friend std::size_t hash_value(const ReferenceElement &r)
Yields a hash value suitable for storing the reference element a in hash table.
Definition: referenceelement.hh:296
auto subEntities(int i, int c, int cc) const
Obtain the range of numbers of subentities with codim cc of (i,c)
Definition: referenceelement.hh:151
ctype Volume
Type used for volume.
Definition: referenceelement.hh:82
Collection of types depending on the codimension.
Definition: referenceelement.hh:65
implementation-defined Geometry
type of geometry embedding a subentity into the reference element
Definition: referenceelement.hh:67