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

#include <entity.hh>

List of all members.


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 are:

  • cd Codimension of the entity
  • dim Dimension of the grid
  • GridImp Type that is a model of Dune::Grid
  • EntityImp Class 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.

This relation is shown in the following diagram:

inline_dotgraph_1.dot

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.


Exported types and constants

enum  { codimension = cd }
enum  { dimension = dim }
enum  { mydimension = dim-cd }
enum  { dimensionworld = dimworld }
typedef GridImp::template
Codim< cd >::Geometry 
Geometry
 The corresponding geometry type.
typedef ct ctype
 coordinate type of the Grid
typedef EntityImp< cd, dim,
GridImp > 
ImplementationType

Protected methods

EntityImp< cd, dim, GridImp > & getRealImp ()
 return reference to the real implementation
const EntityImp< cd, dim,
GridImp > & 
getRealImp () const
 return reference to the real implementation
 Entity (const Entity &rhs)
Entityoperator= (const Entity &rhs)

Methods shared by entities of all codimensions

int level () const
 The level of this entity.
PartitionType partitionType () const
 Partition type of this entity.
const Geometrygeometry () const
 Each entity encapsulates an object of type Dune::Geometry<dimension-codimension,dimensionworld,...> that gives (among other things) the map from a reference element to world coordinates. This method delivers a const reference to such a geometry.

Interface for the implementor

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

Public Member Functions

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

Member Enumeration Documentation

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

Enumerator:
codimension  Know your own codimension.

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

Enumerator:
dimension  Know the grid dimension.

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.

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

Enumerator:
dimensionworld  Know the dimension of world.


Constructor & Destructor Documentation

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 > &  rhs  )  [inline, protected]

hide copy constructor


Member Function Documentation

template<int cd, int dim, class GridImp, template< int, int, class > class EntityImp>
const Geometry& Dune::Entity< cd, dim, GridImp, EntityImp >::geometry (  )  const [inline]

Each entity encapsulates an object of type Dune::Geometry<dimension-codimension,dimensionworld,...> that gives (among other things) the map from a reference element to world coordinates. This method delivers a const reference to such a geometry.

Note:
Be careful when storing such references. If the state of any object is changed, e.g. an iterator is advanced, there is no guarantee that the reference remains valid.

Referenced by Dune::GridPtr< GridType >::parameters().

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 > &  rhs  )  [inline, protected]

hide assignement operator

References Dune::Entity< cd, dim, GridImp, EntityImp >::realEntity.


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

Generated on 6 Nov 2008 with Doxygen (ver 1.5.6) [logfile].