dune-grid 2.9.0
Classes | Public Types | Public Member Functions | Protected Attributes | Related Functions | List of all members
Dune::Entity< 0, dim, GridImp, EntityImp > Class Template Reference

Template specialization of Dune::Entity for Elements (codim==0) More...

#include <dune/grid/common/entity.hh>

Inheritance diagram for Dune::Entity< 0, dim, GridImp, EntityImp >:
Inheritance graph

Classes

struct  Codim
 Entity types of the different codimensions. More...
 

Public Types

typedef EntityImp< 0, dim, GridImp > Implementation
 Type of underlying implementation. More...
 

Public Member Functions

Implementationimpl ()
 Return reference to the real implementation. More...
 
const Implementationimpl () const
 Return const reference to the real implementation. More...
 

Protected Attributes

Implementation realEntity
 

Related Functions

(Note that these are not member functions.)

template<int cd, int dim, class GridImp , template< int, int, class > class EntityImp>
auto referenceElement (const Entity< cd, dim, GridImp, EntityImp > &entity) -> decltype(referenceElement< typename GridImp::ctype, GridImp::template Codim< cd >::Geometry::mydimension >(entity.type()))
 Second-level dispatch to select the correct reference element for a grid entity. More...
 

Exported types and constants

typedef GridImp::template Codim< 0 >::Geometry Geometry
 The geometry type of this entity. More...
 
typedef GridImp::template Codim< 0 >::EntitySeed EntitySeed
 The corresponding entity seed (for storage of entities) More...
 
typedef GridImp::template Codim< 0 >::LocalGeometry LocalGeometry
 The geometry type of this entity when the geometry is expressed embedded in the father element. More...
 
typedef GridImp::HierarchicIterator HierarchicIterator
 The HierarchicIterator type. More...
 
static constexpr int codimension = 0
 Know your own codimension. More...
 
static constexpr int dimension = dim
 Know the grid's dimension. More...
 
static constexpr int mydimension = dim
 Know dimension of the entity. More...
 

Methods shared by entities of all codimensions

int level () const
 The level of this entity. More...
 
PartitionType partitionType () const
 Partition type of this entity. More...
 
Geometry geometry () const
 obtain geometric realization of the entity More...
 
unsigned int subEntities (unsigned int codim) const
 Number of subentities for a given codimension. More...
 
GeometryType type () const
 Return the name of the reference element. The type can be used to access the Dune::ReferenceElement. More...
 
EntitySeed seed () const
 Return the entity seed which contains sufficient information to generate the entity again and uses as little memory as possible. More...
 
bool operator== (const Entity &other) const
 Compares two entities for equality. More...
 
bool operator!= (const Entity &other) const
 Compares two entities for inequality. More...
 
 Entity ()
 
 Entity (const Entity &other)
 Copy constructor from an existing entity. More...
 
 Entity (Entity &&other)
 Move constructor from an existing entity. More...
 
Entityoperator= (const Entity &other)
 Copy assignment operator from an existing entity. More...
 
Entityoperator= (Entity &&other)
 Move assignment operator from an existing entity. More...
 

Extended interface of entities of codimension 0

template<int codim>
Codim< codim >::Entity subEntity (int i) const
 Obtain a subentity. More...
 
Entity father () const
 Inter-level access to father entity on the next-coarser grid. The given entity resulted directly from a subdivision of its father entity. The behaviour for elements on the macro grid, that is when hasFather() is false, is undefined. More...
 
bool hasFather () const
 Return true if entity has a father entity which can be accessed using the father() method. More...
 
bool isLeaf () const
 Returns true if the entity is contained in the leaf grid. More...
 
bool isRegular () const
 Returns true if element is of regular type in red/green type refinement. In bisection or hanging node refinement this is always true. More...
 
LocalGeometry geometryInFather () const
 Provides information how this element has been subdivided from its father element. More...
 
HierarchicIterator hbegin (int maxLevel) const
 Inter-level access to elements that resulted from (recursive) subdivision of this element. More...
 
HierarchicIterator hend (int maxLevel) const
 Returns iterator to one past the last son element. More...
 
bool isNew () const
 Returns true, if the entity has been created during the last call to adapt() More...
 
bool mightVanish () const
 Returns true, if entity might disappear during the next call to adapt(). If the method returns false, the entity is guaranteed to still be present after adaptation. More...
 
bool hasBoundaryIntersections () const
 Returns true, if entity has intersections with boundary. More...
 

Interface for the implementor

 Entity (const EntityImp< 0, dim, GridImp > &e)
 Copy constructor from EntityImp. More...
 
 Entity (EntityImp< 0, dim, GridImp > &&e)
 Move constructor from EntityImp. More...
 

Generic entity ranges for non-standard parallel partitions

These Entity ranges allow for the maximum flexibility; they are parameterized on both the co(cimension) and the parallel PartitionSet.

template<typename E , int codim>
IteratorRange<... > subEntities (const E &e, Codim< codim > c)
 Iterates over all sub-entities of an entity given the codimension of the sub-entities. More...
 

Intersection Range

Iterator range for intersections .

template<typename GV , typename Entity >
IteratorRange<... > intersections (const GV &gv, const Entity &e)
 Iterates over all Intersections of an Entity with respect to the given GridView. More...
 

Hierarchic Entity range

Iterator range for hierarchic access to the more-refined entities that result from the subdivision of a given element.

template<typename Entity >
IteratorRange<... > descendantElements (const Entity &e, int maxLevel)
 Iterates over all descendant elements of the given element up to a maximum level. More...
 

Detailed Description

template<int dim, class GridImp, template< int, int, class > class EntityImp>
class Dune::Entity< 0, dim, GridImp, EntityImp >

Template specialization of Dune::Entity for Elements (codim==0)

Template Parameters
dimDimension of the grid
GridImpType that is a model of Dune::Grid
EntityImpClass template that is a model of Dune::Entity
See also
Dune::Entity (general version) for the full documentation

<int cd, int dim, class GridImp, template<int,int,class> class EntityImp>

Member Typedef Documentation

◆ EntitySeed

template<int dim, class GridImp , template< int, int, class > class EntityImp>
typedef GridImp::template Codim<0>::EntitySeed Dune::Entity< 0, dim, GridImp, EntityImp >::EntitySeed

The corresponding entity seed (for storage of entities)

◆ Geometry

template<int dim, class GridImp , template< int, int, class > class EntityImp>
typedef GridImp::template Codim<0>::Geometry Dune::Entity< 0, dim, GridImp, EntityImp >::Geometry

The geometry type of this entity.

◆ HierarchicIterator

template<int dim, class GridImp , template< int, int, class > class EntityImp>
typedef GridImp::HierarchicIterator Dune::Entity< 0, dim, GridImp, EntityImp >::HierarchicIterator

The HierarchicIterator type.

◆ Implementation

template<int dim, class GridImp , template< int, int, class > class EntityImp>
typedef EntityImp< 0, dim, GridImp > Dune::Entity< 0, dim, GridImp, EntityImp >::Implementation

Type of underlying implementation.

Note
This code may change without prior warning

◆ LocalGeometry

template<int dim, class GridImp , template< int, int, class > class EntityImp>
typedef GridImp::template Codim<0>::LocalGeometry Dune::Entity< 0, dim, GridImp, EntityImp >::LocalGeometry

The geometry type of this entity when the geometry is expressed embedded in the father element.

This differs from Geometry in particular when dim != dimworld, but even when dim == dimworld the implementation may choose to use a different type here.

Constructor & Destructor Documentation

◆ Entity() [1/5]

template<int dim, class GridImp , template< int, int, class > class EntityImp>
Dune::Entity< 0, dim, GridImp, EntityImp >::Entity ( )
inline

◆ Entity() [2/5]

template<int dim, class GridImp , template< int, int, class > class EntityImp>
Dune::Entity< 0, dim, GridImp, EntityImp >::Entity ( const Entity< 0, dim, GridImp, EntityImp > &  other)
inline

Copy constructor from an existing entity.

◆ Entity() [3/5]

template<int dim, class GridImp , template< int, int, class > class EntityImp>
Dune::Entity< 0, dim, GridImp, EntityImp >::Entity ( Entity< 0, dim, GridImp, EntityImp > &&  other)
inline

Move constructor from an existing entity.

◆ Entity() [4/5]

template<int dim, class GridImp , template< int, int, class > class EntityImp>
Dune::Entity< 0, dim, GridImp, EntityImp >::Entity ( const EntityImp< 0, dim, GridImp > &  e)
inline

Copy constructor from EntityImp.

◆ Entity() [5/5]

template<int dim, class GridImp , template< int, int, class > class EntityImp>
Dune::Entity< 0, dim, GridImp, EntityImp >::Entity ( EntityImp< 0, dim, GridImp > &&  e)
inline

Move constructor from EntityImp.

Member Function Documentation

◆ father()

template<int dim, class GridImp , template< int, int, class > class EntityImp>
Entity Dune::Entity< 0, dim, GridImp, EntityImp >::father ( ) const
inline

Inter-level access to father entity on the next-coarser grid. The given entity resulted directly from a subdivision of its father entity. The behaviour for elements on the macro grid, that is when hasFather() is false, is undefined.

Note
If the partitionType of the Entity is GhostEntity, it is not guaranteed that this method is working or implemented in general. For some grids it might be available, though.

◆ geometry()

template<int dim, class GridImp , template< int, int, class > class EntityImp>
Geometry Dune::Entity< 0, dim, GridImp, EntityImp >::geometry ( ) const
inline

obtain geometric realization of the entity

Each entity provides an object of type Dune::Geometry< dimension-codimension, dimensionworld, ... > that represents the map from a reference element to world coordinates.

Note
Previously, the geometry was encapsulated in the entity object and a const reference was returned.
The returned geometry object is guaranteed to remain valid until the grid is modified (or deleted).

◆ geometryInFather()

template<int dim, class GridImp , template< int, int, class > class EntityImp>
LocalGeometry Dune::Entity< 0, dim, GridImp, EntityImp >::geometryInFather ( ) const
inline

Provides information how this element has been subdivided from its father element.

The returned LocalGeometry is a model of Dune::Geometry<dimension,dimension,...>, mapping the reference element of the given entity to the reference element of its father.

This information is sufficient to interpolate all degrees of freedom in the conforming case. Nonconforming may require access to neighbors of the father and calculations with local coordinates. The on-the-fly case is somewhat inefficient since degrees of freedom may be visited several times. If we store interpolation matrices, this is tolerable. We assume that on-the-fly implementation of interpolation is only done for simple discretizations.

Note
For ghost entities, this method is not guaranteed to be implemented.
Previously, the geometry was encapsulated in the entity object and a const reference was returned.
The returned geometry object is guaranteed to remain valid until the grid is modified (or deleted).

◆ hasBoundaryIntersections()

template<int dim, class GridImp , template< int, int, class > class EntityImp>
bool Dune::Entity< 0, dim, GridImp, EntityImp >::hasBoundaryIntersections ( ) const
inline

Returns true, if entity has intersections with boundary.

◆ hasFather()

template<int dim, class GridImp , template< int, int, class > class EntityImp>
bool Dune::Entity< 0, dim, GridImp, EntityImp >::hasFather ( ) const
inline

Return true if entity has a father entity which can be accessed using the father() method.

◆ hbegin()

template<int dim, class GridImp , template< int, int, class > class EntityImp>
HierarchicIterator Dune::Entity< 0, dim, GridImp, EntityImp >::hbegin ( int  maxLevel) const
inline

Inter-level access to elements that resulted from (recursive) subdivision of this element.

Parameters
[in]maxLevelIterator does not stop at elements with level greater than maxlevel.
Returns
Iterator to the first son (level is not greater than maxlevel)
Note
If the partitionType of the Entity is GhostEntity, it is not guaranteed that this method is working or implemented in general. For some grids it might be available, though.

◆ hend()

template<int dim, class GridImp , template< int, int, class > class EntityImp>
HierarchicIterator Dune::Entity< 0, dim, GridImp, EntityImp >::hend ( int  maxLevel) const
inline

Returns iterator to one past the last son element.

Note
If the partitionType of the Entity is GhostEntity, it is not guaranteed that this method is working or implemented in general. For some grids it might be available, though.

◆ impl() [1/2]

template<int dim, class GridImp , template< int, int, class > class EntityImp>
Implementation & Dune::Entity< 0, dim, GridImp, EntityImp >::impl ( )
inline

Return reference to the real implementation.

◆ impl() [2/2]

template<int dim, class GridImp , template< int, int, class > class EntityImp>
const Implementation & Dune::Entity< 0, dim, GridImp, EntityImp >::impl ( ) const
inline

Return const reference to the real implementation.

◆ isLeaf()

template<int dim, class GridImp , template< int, int, class > class EntityImp>
bool Dune::Entity< 0, dim, GridImp, EntityImp >::isLeaf ( ) const
inline

Returns true if the entity is contained in the leaf grid.

◆ isNew()

template<int dim, class GridImp , template< int, int, class > class EntityImp>
bool Dune::Entity< 0, dim, GridImp, EntityImp >::isNew ( ) const
inline

Returns true, if the entity has been created during the last call to adapt()

◆ isRegular()

template<int dim, class GridImp , template< int, int, class > class EntityImp>
bool Dune::Entity< 0, dim, GridImp, EntityImp >::isRegular ( ) const
inline

Returns true if element is of regular type in red/green type refinement. In bisection or hanging node refinement this is always true.

◆ level()

template<int dim, class GridImp , template< int, int, class > class EntityImp>
int Dune::Entity< 0, dim, GridImp, EntityImp >::level ( ) const
inline

The level of this entity.

◆ mightVanish()

template<int dim, class GridImp , template< int, int, class > class EntityImp>
bool Dune::Entity< 0, dim, GridImp, EntityImp >::mightVanish ( ) const
inline

Returns true, if entity might disappear during the next call to adapt(). If the method returns false, the entity is guaranteed to still be present after adaptation.

◆ operator!=()

template<int dim, class GridImp , template< int, int, class > class EntityImp>
bool Dune::Entity< 0, dim, GridImp, EntityImp >::operator!= ( const Entity< 0, dim, GridImp, EntityImp > &  other) const
inline

Compares two entities for inequality.

◆ operator=() [1/2]

template<int dim, class GridImp , template< int, int, class > class EntityImp>
Entity & Dune::Entity< 0, dim, GridImp, EntityImp >::operator= ( const Entity< 0, dim, GridImp, EntityImp > &  other)
inline

Copy assignment operator from an existing entity.

◆ operator=() [2/2]

template<int dim, class GridImp , template< int, int, class > class EntityImp>
Entity & Dune::Entity< 0, dim, GridImp, EntityImp >::operator= ( Entity< 0, dim, GridImp, EntityImp > &&  other)
inline

Move assignment operator from an existing entity.

◆ operator==()

template<int dim, class GridImp , template< int, int, class > class EntityImp>
bool Dune::Entity< 0, dim, GridImp, EntityImp >::operator== ( const Entity< 0, dim, GridImp, EntityImp > &  other) const
inline

Compares two entities for equality.

◆ partitionType()

template<int dim, class GridImp , template< int, int, class > class EntityImp>
PartitionType Dune::Entity< 0, dim, GridImp, EntityImp >::partitionType ( ) const
inline

Partition type of this entity.

◆ seed()

template<int dim, class GridImp , template< int, int, class > class EntityImp>
EntitySeed Dune::Entity< 0, dim, GridImp, EntityImp >::seed ( ) const
inline

Return the entity seed which contains sufficient information to generate the entity again and uses as little memory as possible.

◆ subEntities()

template<int dim, class GridImp , template< int, int, class > class EntityImp>
unsigned int Dune::Entity< 0, dim, GridImp, EntityImp >::subEntities ( unsigned int  codim) const
inline

Number of subentities for a given codimension.

Parameters
codimcodimension to obtain number of subentities for
Note
The codimension is specified with respect to the grid dimension.
Unless the geometry type is None, this method is redundant and the same information can be obtained from the corresponding reference element.

◆ subEntity()

template<int dim, class GridImp , template< int, int, class > class EntityImp>
template<int codim>
Codim< codim >::Entity Dune::Entity< 0, dim, GridImp, EntityImp >::subEntity ( int  i) const
inline

Obtain a subentity.

Template Parameters
codimcodimension of the desired subentity
Parameters
[in]inumber of the subentity (in generic numbering)
Returns
the specified subentity
Note
The subentities are numbered 0, ..., subEntities( codim )-1

◆ type()

template<int dim, class GridImp , template< int, int, class > class EntityImp>
GeometryType Dune::Entity< 0, dim, GridImp, EntityImp >::type ( ) const
inline

Return the name of the reference element. The type can be used to access the Dune::ReferenceElement.

Friends And Related Function Documentation

◆ referenceElement()

template<int cd, int dim, class GridImp , template< int, int, class > class EntityImp>
auto referenceElement ( const Entity< cd, dim, GridImp, EntityImp > &  entity) -> decltype(referenceElement<typename GridImp::ctype,GridImp::template Codim<cd>::Geometry::mydimension>(entity.type()))
related

Second-level dispatch to select the correct reference element for a grid entity.

This function is the default implementation of the second-level reference element dispatch performed by Entity.

When referenceElement() is called with an Entity, it will forward the call to referenceElement<ctype, mydim>(const GeometryType&). This default implementation will do the right thing as long as your geometry is based on a standard Dune ReferenceElement. If it is not and you want to supply your own reference element implementation, provide an override of this function for your specific geometry implementation.

Member Data Documentation

◆ codimension

template<int dim, class GridImp , template< int, int, class > class EntityImp>
constexpr int Dune::Entity< 0, dim, GridImp, EntityImp >::codimension = 0
staticconstexpr

Know your own codimension.

◆ dimension

template<int dim, class GridImp , template< int, int, class > class EntityImp>
constexpr int Dune::Entity< 0, dim, GridImp, EntityImp >::dimension = dim
staticconstexpr

Know the grid's dimension.

◆ mydimension

template<int dim, class GridImp , template< int, int, class > class EntityImp>
constexpr int Dune::Entity< 0, dim, GridImp, EntityImp >::mydimension = dim
staticconstexpr

Know dimension of the entity.

◆ realEntity

template<int dim, class GridImp , template< int, int, class > class EntityImp>
Implementation Dune::Entity< 0, dim, GridImp, EntityImp >::realEntity
protected

The documentation for this class was generated from the following file: