dune-grid  2.4.1-rc2
Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
Dune::EntityIterator< codim, Grid, IteratorImp > Class Template Reference

interface class for an iterator over grid entitiesAn entity iterator is an iterator over a subset of entities within a hierarchical grid. It is an extension of the Dune::EntityPointer interface. More...

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

Inheritance diagram for Dune::EntityIterator< codim, Grid, IteratorImp >:
Inheritance graph

Public Types

typedef Grid::template Codim< codim >::Entity Entity
 
enum  
 codimension of entity pointer More...
 
typedef std::conditional< std::is_lvalue_reference< decltype(realIterator.dereference()) >::value, const Entity &, Entity >::type Reference
 Tpy of the reference used when derefencing the Ptr. More...
 

Public Member Functions

EntityIteratoroperator++ ()
 prefix increment operator More...
 
EntityIterator operator++ (int)
 postfix increment operator More...
 
const Entityoperator* () const
 Dereferencing operator. More...
 
const Entityoperator-> () const
 Pointer operator. More...
 
bool operator== (const EntityIterator &rhs) const
 Checks for equality. More...
 
bool operator!= (const EntityIterator &rhs) const
 Checks for inequality. More...
 
template<class ItImp >
bool operator== (const EntityIterator< codim, Grid, ItImp > &rhs) const
 Checks for equality. Only works for EntityPointers and iterators on the same grid. Due to the conversion operators one can compare all kinds of iterators and EntityPointer. More...
 
template<class ItImp >
bool operator!= (const EntityIterator< codim, Grid, ItImp > &rhs) const
 Checks for inequality. Only works for EntityPointers and iterators on the same grid. Due to the conversion operators one can compare all kinds of iterators and EntityPointer. More...
 
template<class ItImp >
bool operator== (const EntityPointer< Grid, ItImp > &rhs) const
 Checks for equality. Only works for EntityPointers and iterators on the same grid. Due to the conversion operators one can compare all kinds of iterators and EntityPointer. More...
 
template<class ItImp >
bool operator!= (const EntityPointer< Grid, ItImp > &rhs) const
 Checks for inequality. Only works for EntityPointers and iterators on the same grid. Due to the conversion operators one can compare all kinds of iterators and EntityPointer. More...
 
bool operator== (const Entity &rhs) const
 Compares an EntityIterator with an Entity for equality. More...
 
bool operator!= (const Entity &rhs) const
 Compares an EntityIterator with an Entity for inequality. More...
 
DUNE_ENTITYPOINTER_DEPRECATED_MSG bool operator== (const Entity &rhs) const
 Compares an EntityPointer with an Entity for equality. More...
 
DUNE_ENTITYPOINTER_DEPRECATED_MSG bool operator!= (const Entity &rhs) const
 Compares an EntityPointer with an Entity for inequality. More...
 
Implementor's interface
 EntityIterator ()
 default construct (undefined) iterator More...
 
 EntityIterator (const IteratorImp &imp)
 copy constructor from implementaton More...
 
Query methods
int level () const DUNE_ENTITYPOINTER_DEPRECATED_MSG
 Ask for level of entity. More...
 
Implementor interface
bool equals (const EntityPointer< Grid, ItImp > &rhs) const
 Forward equality check to realIterator. More...
 

Protected Types

typedef IteratorImp Implementation
 

Protected Member Functions

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

Protected Attributes

Implementation realIterator
 

Methods and Types of the Entity interface. These are here just for transition purpose

enum  
 
enum  
 
typedef Grid::template Codim< codimension >::Geometry Geometry
 The geometry type of this entity. More...
 
typedef Grid::template Codim< codimension >::EntitySeed EntitySeed
 The corresponding entity seed (for storage of entities) More...
 
typedef Grid::template Codim< codimension >::LocalGeometry LocalGeometry
 The geometry type of this entity when the geometry is expressed embedded in the father element. More...
 
typedef Grid::HierarchicIterator HierarchicIterator
 The codim==0 EntityPointer type. 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...
 
EntitySeed seed () const
 Return the entity seed which contains sufficient information to generate the entity again and uses as little memory as possible. More...
 
Codim< codim >::Entity subEntity (int i) const
 
ONLY_CODIM0 bool hasFather () const
 Return true if entity has a father entity which can be accessed using the father() method. More...
 
ONLY_CODIM0 bool isLeaf () const
 Returns true if the entity is contained in the leaf grid. More...
 
ONLY_CODIM0 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...
 
ONLY_CODIM0 LocalGeometry geometryInFather () const
 Provides information how this element has been subdivided from its father element. More...
 
ONLY_CODIM0 HierarchicIterator hbegin (int maxLevel) const
 Inter-level access to elements that resulted from (recursive) subdivision of this element. More...
 
ONLY_CODIM0 HierarchicIterator hend (int maxLevel) const
 Returns iterator to one past the last son element. More...
 
ONLY_CODIM0 bool isNew () const
 Returns true, if the entity has been created during the last call to adapt() More...
 
ONLY_CODIM0 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...
 
ONLY_CODIM0 bool hasBoundaryIntersections () const
 Returns true, if entity has intersections with boundary. More...
 

Detailed Description

template<int codim, class Grid, class IteratorImp>
class Dune::EntityIterator< codim, Grid, IteratorImp >

interface class for an iterator over grid entities

An entity iterator is an iterator over a subset of entities within a hierarchical grid. It is an extension of the Dune::EntityPointer interface.

Examples of entity iterators are:

See also the documentation of Dune::EntityPointer.

Template Parameters
codimcodimension of entities this iterator walks over
Gridtype of the grid implementation
IteratorImptype of the iterator implementation

Member Typedef Documentation

template<int codim, class Grid , class IteratorImp >
typedef Grid::template Codim< codim >::Entity Dune::EntityIterator< codim, Grid, IteratorImp >::Entity
typedef Grid ::template Codim<codimension>::EntitySeed Dune::EntityPointer< Grid , IteratorImp >::EntitySeed
inherited

The corresponding entity seed (for storage of entities)

typedef Grid ::template Codim<codimension>::Geometry Dune::EntityPointer< Grid , IteratorImp >::Geometry
inherited

The geometry type of this entity.

typedef Grid ::HierarchicIterator Dune::EntityPointer< Grid , IteratorImp >::HierarchicIterator
inherited

The codim==0 EntityPointer type.

The HierarchicIterator type

typedef IteratorImp Dune::EntityPointer< Grid , IteratorImp >::Implementation
protectedinherited
typedef Grid ::template Codim<codimension>::LocalGeometry Dune::EntityPointer< Grid , IteratorImp >::LocalGeometry
inherited

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.

typedef std::conditional< std::is_lvalue_reference< decltype(realIterator.dereference()) >::value, const Entity&, Entity >::type Dune::EntityPointer< Grid , IteratorImp >::Reference
inherited

Tpy of the reference used when derefencing the Ptr.

Member Enumeration Documentation

anonymous enum
inherited

codimension of entity pointer

anonymous enum
inherited
anonymous enum
inherited

Constructor & Destructor Documentation

template<int codim, class Grid , class IteratorImp >
Dune::EntityIterator< codim, Grid, IteratorImp >::EntityIterator ( )
inline

default construct (undefined) iterator

template<int codim, class Grid , class IteratorImp >
Dune::EntityIterator< codim, Grid, IteratorImp >::EntityIterator ( const IteratorImp &  imp)
inline

copy constructor from implementaton

Member Function Documentation

bool Dune::EntityPointer< Grid , IteratorImp >::equals ( const EntityPointer< Grid , ItImp > &  rhs) const
inlineinherited
Geometry Dune::EntityPointer< Grid , IteratorImp >::geometry ( ) const
inlineinherited

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).
ONLY_CODIM0 LocalGeometry Dune::EntityPointer< Grid , IteratorImp >::geometryInFather ( ) const
inlineinherited

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

References ONLY_CODIM0.

ONLY_CODIM0 bool Dune::EntityPointer< Grid , IteratorImp >::hasBoundaryIntersections ( ) const
inlineinherited

Returns true, if entity has intersections with boundary.

ONLY_CODIM0 bool Dune::EntityPointer< Grid , IteratorImp >::hasFather ( ) const
inlineinherited

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

References ONLY_CODIM0.

ONLY_CODIM0 HierarchicIterator Dune::EntityPointer< Grid , IteratorImp >::hbegin ( int  maxLevel) const
inlineinherited

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.

References ONLY_CODIM0.

ONLY_CODIM0 HierarchicIterator Dune::EntityPointer< Grid , IteratorImp >::hend ( int  maxLevel) const
inlineinherited

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.

References ONLY_CODIM0.

Implementation& Dune::EntityPointer< Grid , IteratorImp >::impl ( )
inlineprotectedinherited

return reference to the real implementation

References Dune::EntityPointer< GridImp, IteratorImp >::realIterator.

const Implementation& Dune::EntityPointer< Grid , IteratorImp >::impl ( ) const
inlineprotectedinherited

return reference to the real implementation

References Dune::EntityPointer< GridImp, IteratorImp >::realIterator.

ONLY_CODIM0 bool Dune::EntityPointer< Grid , IteratorImp >::isLeaf ( ) const
inlineinherited

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

References ONLY_CODIM0.

ONLY_CODIM0 bool Dune::EntityPointer< Grid , IteratorImp >::isNew ( ) const
inlineinherited

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

References ONLY_CODIM0.

ONLY_CODIM0 bool Dune::EntityPointer< Grid , IteratorImp >::isRegular ( ) const
inlineinherited

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

References ONLY_CODIM0.

int Dune::EntityPointer< Grid , IteratorImp >::level ( ) const
inlineinherited

Ask for level of entity.

This method is redundant and is only there for efficiency reasons. It allows an implementation to return the level without actually constructing the entity.

Deprecated:
Will be removed after the release of dune-grid-2.4. Use the method level() from the dereferenced Entity instead.
ONLY_CODIM0 bool Dune::EntityPointer< Grid , IteratorImp >::mightVanish ( ) const
inlineinherited

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.

References ONLY_CODIM0.

template<int codim, class Grid , class IteratorImp >
bool Dune::EntityIterator< codim, Grid, IteratorImp >::operator!= ( const EntityIterator< codim, Grid, IteratorImp > &  rhs) const
inline
template<int codim, class Grid , class IteratorImp >
template<class ItImp >
bool Dune::EntityIterator< codim, Grid, IteratorImp >::operator!= ( const EntityIterator< codim, Grid, ItImp > &  rhs) const
inline

Checks for inequality. Only works for EntityPointers and iterators on the same grid. Due to the conversion operators one can compare all kinds of iterators and EntityPointer.

Deprecated:
Comparing different types of iterators is deprecated and will be removed after the release of dune-grid 2.4. If you want to compare the entities pointed at by the iterators, dereference the iterators before comparing them.
Deprecated:
"Comparing different types of iterators is deprecated and will be removed after the \release of dune-grid 2.4. If you want to compare the entities pointed at by the iterators, dereference the \iterators before comparing them."

References Dune::EntityPointer< Grid, IteratorImp >::equals().

template<int codim, class Grid , class IteratorImp >
template<class ItImp >
bool Dune::EntityIterator< codim, Grid, IteratorImp >::operator!= ( const EntityPointer< Grid, ItImp > &  rhs) const
inline

Checks for inequality. Only works for EntityPointers and iterators on the same grid. Due to the conversion operators one can compare all kinds of iterators and EntityPointer.

Deprecated:
Comparing different types of iterators is deprecated and will be removed after the release of dune-grid 2.4. If you want to compare the entities pointed at by the iterators, dereference the iterators before comparing them.
Deprecated:
"EntityPointer is deprecated will be removed after the release of dune-grid 2.4. \Moreover, comparing different types of iterators is deprecated as well and will also be removed after the \release of dune-grid 2.4. If you want to compare the entities pointed at by the iterators, dereference the \iterators before comparing them."

References Dune::EntityPointer< Grid, IteratorImp >::equals().

template<int codim, class Grid , class IteratorImp >
bool Dune::EntityIterator< codim, Grid, IteratorImp >::operator!= ( const Entity rhs) const
inline

Compares an EntityIterator with an Entity 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.
Deprecated:
"EntityPointer is deprecated and will be removed after the release of dune-grid-2.4. \Instead, you can copy and store entities directly now. You probably stumbled across this warning because you \compared the return value of Entity::father(), Entity::subEntity(), Intersection::inside() or \Intersection::outside() with an iterator. To fix the problem, derefence the iterator before comparing."
DUNE_ENTITYPOINTER_DEPRECATED_MSG bool Dune::EntityPointer< Grid , IteratorImp >::operator!= ( const Entity rhs) const
inlineinherited

Compares an EntityPointer with an Entity 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.
template<int codim, class Grid , class IteratorImp >
const Entity& Dune::EntityIterator< codim, Grid, IteratorImp >::operator* ( ) const
template<int codim, class Grid , class IteratorImp >
EntityIterator& Dune::EntityIterator< codim, Grid, IteratorImp >::operator++ ( )
inline

prefix increment operator

References Dune::EntityPointer< Grid, IteratorImp >::realIterator.

template<int codim, class Grid , class IteratorImp >
EntityIterator Dune::EntityIterator< codim, Grid, IteratorImp >::operator++ ( int  )
inline
template<int codim, class Grid , class IteratorImp >
const Entity* Dune::EntityIterator< codim, Grid, IteratorImp >::operator-> ( ) const
template<int codim, class Grid , class IteratorImp >
bool Dune::EntityIterator< codim, Grid, IteratorImp >::operator== ( const EntityIterator< codim, Grid, IteratorImp > &  rhs) const
inline
template<int codim, class Grid , class IteratorImp >
template<class ItImp >
bool Dune::EntityIterator< codim, Grid, IteratorImp >::operator== ( const EntityIterator< codim, Grid, ItImp > &  rhs) const
inline

Checks for equality. Only works for EntityPointers and iterators on the same grid. Due to the conversion operators one can compare all kinds of iterators and EntityPointer.

Deprecated:
Comparing different types of iterators is deprecated and will be removed after the release of dune-grid 2.4. If you want to compare the entities pointed at by the iterators, dereference the iterators before comparing them.
Deprecated:
"Comparing different types of iterators is deprecated and will be removed after the \release of dune-grid 2.4. If you want to compare the entities pointed at by the iterators, dereference the \iterators before comparing them."

References Dune::EntityPointer< Grid, IteratorImp >::equals().

template<int codim, class Grid , class IteratorImp >
template<class ItImp >
bool Dune::EntityIterator< codim, Grid, IteratorImp >::operator== ( const EntityPointer< Grid, ItImp > &  rhs) const
inline

Checks for equality. Only works for EntityPointers and iterators on the same grid. Due to the conversion operators one can compare all kinds of iterators and EntityPointer.

Deprecated:
Comparing different types of iterators is deprecated and will be removed after the release of dune-grid 2.4. If you want to compare the entities pointed at by the iterators, dereference the iterators before comparing them.
Deprecated:
"EntityPointer is deprecated will be removed after the release of dune-grid 2.4. \Moreover, comparing different types of iterators is deprecated as well and will also be removed after the \release of dune-grid 2.4. If you want to compare the entities pointed at by the iterators, dereference the \iterators before comparing them."

References Dune::EntityPointer< Grid, IteratorImp >::equals().

template<int codim, class Grid , class IteratorImp >
bool Dune::EntityIterator< codim, Grid, IteratorImp >::operator== ( const Entity rhs) const
inline

Compares an EntityIterator with an Entity 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.
Deprecated:
"EntityPointer is deprecated and will be removed after the release of dune-grid-2.4. \Instead, you can copy and store entities directly now. You probably stumbled across this warning because you \compared the return value of Entity::father(), Entity::subEntity(), Intersection::inside() or \Intersection::outside() with an iterator. To fix the problem, derefence the iterator before comparing."
DUNE_ENTITYPOINTER_DEPRECATED_MSG bool Dune::EntityPointer< Grid , IteratorImp >::operator== ( const Entity rhs) const
inlineinherited

Compares an EntityPointer with an Entity 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.
PartitionType Dune::EntityPointer< Grid , IteratorImp >::partitionType ( ) const
inlineinherited

Partition type of this entity.

EntitySeed Dune::EntityPointer< Grid , IteratorImp >::seed ( ) const
inlineinherited

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

Codim<codim>::Entity Dune::EntityPointer< Grid , IteratorImp >::subEntity ( int  i) const
inlineinherited

References ONLY_CODIM0.

GeometryType Dune::EntityPointer< Grid , IteratorImp >::type ( ) const
inlineinherited

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

Referenced by Dune::EntityIterator< codim, Grid, IteratorImp >::operator++().

Member Data Documentation

Implementation Dune::EntityPointer< Grid , IteratorImp >::realIterator
protectedinherited

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