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

Wrapper class for entities. More...

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

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

Public Types

typedef EntityImp< cd, dim, GridImp > Implementation
 type of underlying implementation More...
 

Public Member Functions

Implementationimpl ()
 access to the underlying implementation More...
 
const Implementationimpl () const
 access to the underlying 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< cd >::Geometry Geometry
 The corresponding geometry type. More...
 
typedef GridImp::template Codim< cd >::EntitySeed EntitySeed
 The corresponding entity seed (for storage of entities) More...
 
static constexpr int codimension = cd
 Know your own codimension. More...
 
static constexpr int dimension = dim
 Know the grid dimension. More...
 
static constexpr int mydimension = dim - cd
 Dimensionality of the reference element 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...
 
GeometryType type () const
 Return the name of the reference element. The type can be used to access the Dune::ReferenceElement. More...
 
unsigned int subEntities (unsigned int codim) const
 Number of subentities for a given codimension. 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...
 

Interface for the implementor

 Entity (const EntityImp< cd, dim, GridImp > &e)
 Copy constructor from EntityImp. More...
 
 Entity (EntityImp< cd, dim, GridImp > &&e)
 Move constructor from EntityImp. 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...
 

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...
 

Detailed Description

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

Wrapper class for entities.

Template Parameters
cdCodimension of the entity
dimDimension of the grid
GridImpType that is a model of Dune::Grid
EntityImpClass template that is a model of Dune::Entity

Engine Concept

This class wraps a object of type EntityImp and forwards all member function calls to corresponding members of this class. In that sense Entity defines the interface and EntityImp supplies the implementation. For various reasons we do not use an inheritance hierarchy and the Barton-Nackman trick here.

Specialization

The Entity class template is specialized for cd=0 (elements, Dune::Entity<0,dim,GridImp,EntityImp>). This case has an extended interface. The methods defined in the general template are provided by the specialization as well. We did not use inheritance because different implementations for different codimensions may be required and virtual functions had to be avoided.

View concept

Entities can not be created, assigned or otherwise modified outside the interface in the user code. They are only accessible by immutable iterators provided on the corresponding grid class.

The only way to modify the entities of a grid is through grid adaptation which consists of tagging entities (of codimension 0) for refinement and then calling the adapt() method on the grid.

Member Typedef Documentation

◆ EntitySeed

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

The corresponding entity seed (for storage of entities)

◆ Geometry

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

The corresponding geometry type.

◆ Implementation

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

type of underlying implementation

Warning
Implementation details may change without prior notification.

Constructor & Destructor Documentation

◆ Entity() [1/5]

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

◆ Entity() [2/5]

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

Copy constructor from an existing entity.

◆ Entity() [3/5]

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

Move constructor from an existing entity.

◆ Entity() [4/5]

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

Copy constructor from EntityImp.

◆ Entity() [5/5]

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

Move constructor from EntityImp.

Member Function Documentation

◆ geometry()

template<int cd, int dim, class GridImp , template< int, int, class > class EntityImp>
Geometry Dune::Entity< cd, 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).

◆ impl() [1/2]

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

access to the underlying implementation

Warning
Implementation details may change without prior notification.

◆ impl() [2/2]

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

access to the underlying implementation

Warning
Implementation details may change without prior notification.

◆ level()

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

The level of this entity.

◆ operator!=()

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

Compares two entities for inequality.

◆ operator=() [1/2]

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

Copy assignment operator from an existing entity.

◆ operator=() [2/2]

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

Move assignment operator from an existing entity.

◆ operator==()

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

Compares two entities for equality.

◆ partitionType()

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

Partition type of this entity.

◆ seed()

template<int cd, int dim, class GridImp , template< int, int, class > class EntityImp>
EntitySeed Dune::Entity< cd, 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 cd, int dim, class GridImp , template< int, int, class > class EntityImp>
unsigned int Dune::Entity< cd, 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.

◆ type()

template<int cd, int dim, class GridImp , template< int, int, class > class EntityImp>
GeometryType Dune::Entity< cd, 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 cd, int dim, class GridImp , template< int, int, class > class EntityImp>
constexpr int Dune::Entity< cd, dim, GridImp, EntityImp >::codimension = cd
staticconstexpr

Know your own codimension.

◆ dimension

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

Know the grid dimension.

◆ mydimension

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

Dimensionality of the reference element of the entity.

◆ realEntity

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

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