Dune Core Modules (2.4.2)

Dune::Entity< cd, dim, GridImp, EntityImp > Class Template Reference

Wrapper class for entities. More...

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

Protected Member Functions

Implementation & impl ()
 Return reference to the real implementation.
 
const Implementation & impl () const
 Return const reference to the real implementation.
 

Exported types and constants

enum  { codimension =cd }
 
enum  { dimension =dim }
 
enum  { mydimension =dim-cd }
 
typedef GridImp::template Codim< cd >::Geometry Geometry
 The corresponding geometry type.
 
typedef GridImp::template Codim< cd >::EntitySeed EntitySeed
 The corresponding entity seed (for storage of entities)
 

Interface for the implementor

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

Methods shared by entities of all codimensions

int level () const
 The level of this entity.
 
PartitionType partitionType () const
 Partition type of this entity.
 
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.
 
EntitySeed seed () const
 Return the entity seed which contains sufficient information to generate the entity again and uses as little memory as possible.
 
bool operator== (const Entity &other) const
 Compares two entities for equality.
 
bool operator!= (const Entity &other) const
 Compares two entities for inequality.
 
template<typename ItImp >
bool operator== (const Dune::EntityPointer< GridImp, ItImp > &other) const
 Compares an Entity with an EntityPointer for equality. More...
 
template<typename ItImp >
bool operator!= (const Dune::EntityPointer< GridImp, ItImp > &other) const
 Compares an Entity with an EntityPointer for inequality. More...
 
 Entity ()
 
 Entity (const Entity &other)
 Copy constructor from an existing entity.
 
 Entity (Entity &&other)
 Move constructor from an existing entity.
 
Entityoperator= (const Entity &other)
 Copy assignment operator from an existing entity.
 
Entityoperator= (Entity &&other)
 Move assignment operator from an existing entity.
 
const Entityoperator* () const DUNE_DEPRECATED_MSG("This is now an Entity instead of an EntityPointer. You do not have to dereference it anymore!")
 Dereference Entity to itself for backwards compatibility with EntityPointer. More...
 
const Entityoperator-> () const DUNE_DEPRECATED_MSG("This is now an Entity instead of an EntityPointer. You do not have to dereference it anymore!")
 Dereference Entity to itself for backwards compatibility with EntityPointer. 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 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 Enumeration Documentation

◆ anonymous enum

template<int cd, int dim, class GridImp , template< int, int, class > class EntityImp>
anonymous enum
Enumerator
codimension 

Know your own codimension.

◆ anonymous enum

template<int cd, int dim, class GridImp , template< int, int, class > class EntityImp>
anonymous enum
Enumerator
dimension 

Know the grid dimension.

◆ anonymous enum

template<int cd, int dim, class GridImp , template< int, int, class > class EntityImp>
anonymous enum
Enumerator
mydimension 

Dimensionality of the reference element of the entity.

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

◆ operator!=()

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

Compares an Entity with an EntityPointer for inequality.

Deprecated:
This method only exists for backwards compatibility during the 2.4 release cycle and will be removed after dune-grid-2.4 is released.

◆ operator*()

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

Dereference Entity to itself for backwards compatibility with EntityPointer.

Deprecated:
This method only exists to provide backwards compatibility for dune-grid-2.4. It will be removed after the release of dune-grid-2.4.

◆ operator->()

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

Dereference Entity to itself for backwards compatibility with EntityPointer.

Deprecated:
This method only exists to provide backwards compatibility for dune-grid-2.4. It will be removed after the release of dune-grid-2.4.

◆ operator==()

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

Compares an Entity with an EntityPointer for equality.

Deprecated:
This method only exists for backwards compatibility during the 2.4 release cycle and will be removed after dune-grid-2.4 is released.

The documentation for this class was generated from the following files:
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Dec 29, 23:29, 2024)