Dune Core Modules (2.4.2)

Dune::EntityIterator< codim, Grid, IteratorImp > Class Template Reference

interface class for an iterator over grid entities More...

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

Public Types

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

Public Member Functions

EntityIteratoroperator++ ()
 prefix increment operator
 
EntityIterator operator++ (int)
 postfix increment operator
 
const Entity & operator* () const
 Dereferencing operator.
 
const Entity * operator-> () const
 Pointer operator.
 
bool operator== (const EntityIterator &rhs) const
 Checks for equality.
 
bool operator!= (const EntityIterator &rhs) const
 Checks for inequality.
 
Compare methods
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.
 
DUNE_ENTITYPOINTER_DEPRECATED_MSG bool operator== (const Entity &rhs) const
 Compares an EntityPointer with an Entity for equality. More...
 
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.
 
DUNE_ENTITYPOINTER_DEPRECATED_MSG bool operator!= (const Entity &rhs) const
 Compares an EntityPointer with an Entity for inequality. 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.
 

Protected Member Functions

Implementation & impl ()
 return reference to the real implementation
 
const Implementation & impl () const
 return reference to the real implementation
 

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

enum  
 
enum  
 
typedef GridImp::template Codim< codimension >::Geometry Geometry
 The geometry type of this entity.
 
typedef GridImp::template Codim< codimension >::EntitySeed EntitySeed
 The corresponding entity seed (for storage of entities)
 
typedef GridImp::template Codim< codimension >::LocalGeometry LocalGeometry
 The geometry type of this entity when the geometry is expressed embedded in the father element. More...
 
typedef GridImp::HierarchicIterator HierarchicIterator
 The codim==0 EntityPointer type. More...
 
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.
 
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.
 
ONLY_CODIM0 bool isLeaf () const
 Returns true if the entity is contained in the leaf grid.
 
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.
 
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()
 
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.
 
ONLY_CODIM0 bool hasBoundaryIntersections () const
 Returns true, if entity has intersections with boundary.
 

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:

  • iterators over the leaf level (LeafGridView::Iterator)
  • iterators over a grid level (LevelGridView::Iterator)
  • iterators over the children of an entity (Grid::HierarchicIterator)

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

◆ HierarchicIterator

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

The codim==0 EntityPointer type.

The HierarchicIterator type

◆ LocalGeometry

typedef GridImp::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.

Member Function Documentation

◆ geometry()

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

◆ geometryInFather()

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

◆ hbegin()

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.

◆ hend()

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.

◆ level()

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.

◆ operator!=()

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.

◆ operator==()

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.

The documentation for this class was generated from the following file:
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Oct 6, 22:30, 2024)