Dune::cpgrid::Iterator< cd, pitype > Class Template Reference

#include <Iterators.hpp>

Inheritance diagram for Dune::cpgrid::Iterator< cd, pitype >:
Inheritance graph

Public Types

using Reference = const Entity< cd > &
 
enum  
 
enum  
 
enum  
 
enum  
 
typedef Entity EntitySeed
 
typedef cpgrid::Geometry< 3-codim, 3 > Geometry
 
typedef Geometry LocalGeometry
 
typedef cpgrid::IntersectionIterator LeafIntersectionIterator
 
typedef cpgrid::IntersectionIterator LevelIntersectionIterator
 
typedef cpgrid::HierarchicIterator HierarchicIterator
 
typedef double ctype
 
enum  { codimension =codim }
 
enum  { InvalidIndex = INT_MAX }
 

Public Member Functions

 Iterator (const CpGridData &grid, int index, bool orientation)
 
Iteratoroperator++ ()
 
const Entity< cd > * operator-> () const
 Const member by pointer operator. More...
 
const Entity< cd > & operator* () const
 Const dereferencing operator. More...
 
bool operator== (const Entity &other) const
 Equality. More...
 
bool operator== (const EntityRep &other) const
 Equality operator. More...
 
bool operator!= (const Entity &other) const
 Inequality. More...
 
bool operator!= (const EntityRep &other) const
 Inequality operator. More...
 
EntitySeed seed () const
 Return an entity seed (light-weight entity). EntitySeed objects are used to obtain an Entity back when combined with the corresponding grid. For CpGrid, EntitySeed and EntityPtr are the same class. More...
 
const Geometrygeometry () const
 Return the geometry of the entity (does not depend on its orientation). More...
 
int level () const
 Return the level of the entity in the grid hierarchy. Level = 0 represents the coarsest grid. More...
 
bool isLeaf () const
 Check if the entity is in the leafview. More...
 
bool isRegular () const
 Refinement is not defined for CpGrid. More...
 
PartitionType partitionType () const
 For now, the grid is serial and the only partitionType() is InteriorEntity. Only needed when distributed_data_ is not empty. More...
 
GeometryType type () const
 Return marker object (GeometryType object) representing the reference element of the entity. Currently, cube type for all entities (cells and vertices). More...
 
unsigned int subEntities (const unsigned int cc) const
 Return the number of all subentities of the entity of a given codimension cc. More...
 
Codim< cc >::Entity subEntity (int i) const
 Obtain subentity. Example: If cc = 3 and i = 5, it returns the 5th corner/vertex of the entity. More...
 
Entity< codim >::template Codim< cc >::Entity subEntity (int i) const
 
LevelIntersectionIterator ilevelbegin () const
 Start level-iterator for the cell-cell intersections of this entity. More...
 
LevelIntersectionIterator ilevelend () const
 End level-iterator for the cell-cell intersections of this entity. More...
 
LeafIntersectionIterator ileafbegin () const
 Start leaf-iterator for the cell-cell intersections of this entity. More...
 
LeafIntersectionIterator ileafend () const
 End leaf-iterator for the cell-cell intersections of this entity. More...
 
HierarchicIterator hbegin (int) const
 Iterator begin over the children. [If requested, also over descendants more than one generation away.]. More...
 
HierarchicIterator hend (int) const
 Iterator end over the children/beyond last child iterator. More...
 
bool isNew () const
 Returns true, if the entity has been created during the last call to adapt(). Dummy. More...
 
bool mightVanish () const
 Returns true, if entity might disappear during the next call to adapt(). Dummy. More...
 
bool hasFather () const
 ONLY FOR CELLS (Entity<0>) Check if the entity comes from an LGR, i.e., it has been created via refinement from coarser level. More...
 
Entity< 0 > father () const
 ONLY FOR CELLS (Entity<0>). Get the father Entity, in case entity.hasFather() is true. More...
 
Dune::cpgrid::Geometry< 3, 3 > geometryInFather () const
 Return LocalGeometry representing the embedding of the entity into its father (when hasFather() is true). Map from the entity's reference element into the reference element of its father. Currently, LGR is built via refinement of a block-shaped patch from the coarse grid. So the LocalGeometry of an entity coming from the LGR is one of the refined cells of the unit cube, with suitable amount of cells in each direction. More...
 
bool hasBoundaryIntersections () const
 
const Entityimpl () const
 Access the actual implementation class behind Entity interface class. More...
 
Entityimpl ()
 
bool isValid () const
 
Entity< 0 > getOrigin () const
 
Entity< 0 > getLevelElem () const
 Get equivalent element on the level grid view for an element on the leaf grid view. More...
 
int getLevelCartesianIdx () const
 Get Cartesian Index in the level grid view where the Entity was born. More...
 
void setValue (int index_arg, bool orientation_arg)
 Set entity value. More...
 
int index () const
 The (positive) index of an entity. Not a Dune interface method. More...
 
int signedIndex () const
 The signed index that also tells us the orientation. More...
 
bool orientation () const
 Returns true if the entity has positive orientation. Not a Dune interface method. More...
 
EntityRep opposite () const
 Returns an EntityRep with opposite orientation. More...
 
void increment ()
 Increments the entityrep's index() by one. More...
 
bool operator< (const EntityRep &other) const
 Ordering relation used for maps etc. More...
 

Protected Attributes

const CpGridDatapgrid_
 

Detailed Description

template<int cd, PartitionIteratorType pitype>
class Dune::cpgrid::Iterator< cd, pitype >

Iterator intended to be used as LeafIterator and LevelIterator (no difference due to no adaptivity) for CpGrid. This could have been a random access iterator, perhaps we will use a facade to do this later.

Member Typedef Documentation

◆ ctype

typedef double Dune::cpgrid::Entity< codim >::ctype
inherited

◆ EntitySeed

typedef Entity Dune::cpgrid::Entity< codim >::EntitySeed
inherited

◆ Geometry

typedef cpgrid::Geometry<3-codim,3> Dune::cpgrid::Entity< codim >::Geometry
inherited

◆ HierarchicIterator

typedef cpgrid::HierarchicIterator Dune::cpgrid::Entity< codim >::HierarchicIterator
inherited

◆ LeafIntersectionIterator

typedef cpgrid::IntersectionIterator Dune::cpgrid::Entity< codim >::LeafIntersectionIterator
inherited

◆ LevelIntersectionIterator

typedef cpgrid::IntersectionIterator Dune::cpgrid::Entity< codim >::LevelIntersectionIterator
inherited

◆ LocalGeometry

typedef Geometry Dune::cpgrid::Entity< codim >::LocalGeometry
inherited

◆ Reference

template<int cd, PartitionIteratorType pitype>
using Dune::cpgrid::Iterator< cd, pitype >::Reference = const Entity<cd>&

Member Enumeration Documentation

◆ anonymous enum

template<int codim>
anonymous enum
inherited
Enumerator
InvalidIndex 

◆ anonymous enum

anonymous enum
inherited

◆ anonymous enum

anonymous enum
inherited

◆ anonymous enum

anonymous enum
inherited

◆ anonymous enum

anonymous enum
inherited

◆ anonymous enum

template<int codim>
anonymous enum
inherited
Enumerator
codimension 

Constructor & Destructor Documentation

◆ Iterator()

template<int cd, PartitionIteratorType pitype>
Dune::cpgrid::Iterator< cd, pitype >::Iterator ( const CpGridData grid,
int  index,
bool  orientation 
)

Member Function Documentation

◆ father()

Entity< 0 > Dune::cpgrid::Entity< codim >::father
inherited

ONLY FOR CELLS (Entity<0>). Get the father Entity, in case entity.hasFather() is true.

Returns
father-entity

◆ geometry()

const Entity< codim >::Geometry & Dune::cpgrid::Entity< codim >::geometry
inherited

Return the geometry of the entity (does not depend on its orientation).

◆ geometryInFather()

Dune::cpgrid::Geometry< 3, 3 > Dune::cpgrid::Entity< codim >::geometryInFather
inherited

Return LocalGeometry representing the embedding of the entity into its father (when hasFather() is true). Map from the entity's reference element into the reference element of its father. Currently, LGR is built via refinement of a block-shaped patch from the coarse grid. So the LocalGeometry of an entity coming from the LGR is one of the refined cells of the unit cube, with suitable amount of cells in each direction.

◆ getLevelCartesianIdx()

int Dune::cpgrid::Entity< codim >::getLevelCartesianIdx
inherited

Get Cartesian Index in the level grid view where the Entity was born.

◆ getLevelElem()

Dune::cpgrid::Entity< 0 > Dune::cpgrid::Entity< codim >::getLevelElem
inherited

Get equivalent element on the level grid view for an element on the leaf grid view.

◆ getOrigin()

Dune::cpgrid::Entity< 0 > Dune::cpgrid::Entity< codim >::getOrigin
inherited

getOrigin() Returns parent entity in level 0, if the entity was born in any LGR. Otherwise, returns itself.

◆ hasBoundaryIntersections()

bool Dune::cpgrid::Entity< codim >::hasBoundaryIntersections
inherited

Returns true if any of my intersections are on the boundary. Implementation note: This is a slow, computed, function. Could be speeded up by putting boundary info in the CpGrid class.

◆ hasFather()

bool Dune::cpgrid::Entity< codim >::hasFather
inherited

ONLY FOR CELLS (Entity<0>) Check if the entity comes from an LGR, i.e., it has been created via refinement from coarser level.

@TODO: When distributed_data_ is not empty, check whether the father element exists on the local process, which can be used to test whether it is safe to call father.

◆ hbegin()

HierarchicIterator Dune::cpgrid::Entity< codim >::hbegin ( int  maxLevel) const
inherited

Iterator begin over the children. [If requested, also over descendants more than one generation away.].

◆ hend()

HierarchicIterator Dune::cpgrid::Entity< codim >::hend ( int  maxLevel) const
inherited

Iterator end over the children/beyond last child iterator.

Dummy beyond last child iterator.

◆ ileafbegin()

Entity< codim >::LeafIntersectionIterator Dune::cpgrid::Entity< codim >::ileafbegin
inlineinherited

Start leaf-iterator for the cell-cell intersections of this entity.

◆ ileafend()

Entity< codim >::LeafIntersectionIterator Dune::cpgrid::Entity< codim >::ileafend
inlineinherited

End leaf-iterator for the cell-cell intersections of this entity.

◆ ilevelbegin()

Entity< codim >::LevelIntersectionIterator Dune::cpgrid::Entity< codim >::ilevelbegin
inlineinherited

Start level-iterator for the cell-cell intersections of this entity.

◆ ilevelend()

Entity< codim >::LevelIntersectionIterator Dune::cpgrid::Entity< codim >::ilevelend
inlineinherited

End level-iterator for the cell-cell intersections of this entity.

◆ impl() [1/2]

Entity & Dune::cpgrid::Entity< codim >::impl ( )
inlineinherited

◆ impl() [2/2]

const Entity & Dune::cpgrid::Entity< codim >::impl ( ) const
inlineinherited

Access the actual implementation class behind Entity interface class.

◆ increment()

template<int codim>
void Dune::cpgrid::EntityRep< codim >::increment ( )
inlineinherited

◆ index()

◆ isLeaf()

bool Dune::cpgrid::Entity< codim >::isLeaf
inherited

Check if the entity is in the leafview.

   @TODO: Modify the definition to cover serial and parallel cases.
   Serial: an element is a leaf <-> hbegin and hend return the same iterator
   Parallel: true <-> the element is a leaf entity of the global refinement hierarchy. 

◆ isNew()

bool Dune::cpgrid::Entity< codim >::isNew ( ) const
inlineinherited

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

◆ isRegular()

bool Dune::cpgrid::Entity< codim >::isRegular ( ) const
inlineinherited

Refinement is not defined for CpGrid.

◆ isValid()

bool Dune::cpgrid::Entity< codim >::isValid
inherited

isValid method for EntitySeed

Returns
return true if seed is pointing to a valid entity

◆ level()

int Dune::cpgrid::Entity< codim >::level
inherited

Return the level of the entity in the grid hierarchy. Level = 0 represents the coarsest grid.

◆ mightVanish()

bool Dune::cpgrid::Entity< codim >::mightVanish ( ) const
inlineinherited

Returns true, if entity might disappear during the next call to adapt(). Dummy.

◆ operator!=() [1/2]

bool Dune::cpgrid::Entity< codim >::operator!= ( const Entity< cd > &  other) const
inlineinherited

Inequality.

◆ operator!=() [2/2]

template<int codim>
bool Dune::cpgrid::EntityRep< codim >::operator!= ( const EntityRep< codim > &  other) const
inlineinherited

Inequality operator.

Parameters
otherThe other entity representation.
Returns
true if this and the other element are not equal.

References Dune::cpgrid::EntityRep< codim >::operator==().

◆ operator*()

template<int cd, PartitionIteratorType pitype>
const Entity< cd > & Dune::cpgrid::Iterator< cd, pitype >::operator* ( ) const
inline

Const dereferencing operator.

◆ operator++()

template<int cd, PartitionIteratorType pitype>
Iterator & Dune::cpgrid::Iterator< cd, pitype >::operator++ ( )
inline

Increment operator. Implementation note: This class is a friend of

See also
EntityRep (which is a private base class of Entity) in order to actually access the private variable entityrep_. We may want to change EntityRep, then this must change, too.

References Dune::cpgrid::EntityRep< codim >::increment(), and Dune::cpgrid::EntityRep< codim >::index().

◆ operator->()

template<int cd, PartitionIteratorType pitype>
const Entity< cd > * Dune::cpgrid::Iterator< cd, pitype >::operator-> ( ) const
inline

Const member by pointer operator.

◆ operator<()

template<int codim>
bool Dune::cpgrid::EntityRep< codim >::operator< ( const EntityRep< codim > &  other) const
inlineinherited

Ordering relation used for maps etc.

Sorting on index and then orientation, with positive orientations first.

Parameters
otherThe other entity representation.
Returns
true if this element is less than the other.

References Dune::cpgrid::EntityRep< codim >::index(), and Dune::cpgrid::EntityRep< codim >::orientation().

◆ operator==() [1/2]

bool Dune::cpgrid::Entity< codim >::operator== ( const Entity< cd > &  other) const
inlineinherited

Equality.

◆ operator==() [2/2]

template<int codim>
bool Dune::cpgrid::EntityRep< codim >::operator== ( const EntityRep< codim > &  other) const
inlineinherited

Equality operator.

Parameters
otherThe other entity representation.
Returns
true if this and the other element are equal.

Referenced by Dune::cpgrid::EntityRep< codim >::operator!=(), and Dune::cpgrid::Entity< codim >::operator==().

◆ opposite()

◆ orientation()

◆ partitionType()

PartitionType Dune::cpgrid::Entity< codim >::partitionType
inherited

For now, the grid is serial and the only partitionType() is InteriorEntity. Only needed when distributed_data_ is not empty.

◆ seed()

EntitySeed Dune::cpgrid::Entity< codim >::seed ( ) const
inlineinherited

Return an entity seed (light-weight entity). EntitySeed objects are used to obtain an Entity back when combined with the corresponding grid. For CpGrid, EntitySeed and EntityPtr are the same class.

◆ setValue()

template<int codim>
void Dune::cpgrid::EntityRep< codim >::setValue ( int  index_arg,
bool  orientation_arg 
)
inlineinherited

Set entity value.

Parameters
indexEntity index
orientationTrue if the entity's orientation is positive.

◆ signedIndex()

template<int codim>
int Dune::cpgrid::EntityRep< codim >::signedIndex ( ) const
inlineinherited

The signed index that also tells us the orientation.

◆ subEntities()

unsigned int Dune::cpgrid::Entity< codim >::subEntities ( const unsigned int  cc) const
inherited

Return the number of all subentities of the entity of a given codimension cc.

◆ subEntity() [1/2]

Codim< cc >::Entity Dune::cpgrid::Entity< codim >::subEntity ( int  i) const
inherited

Obtain subentity. Example: If cc = 3 and i = 5, it returns the 5th corner/vertex of the entity.

◆ subEntity() [2/2]

Entity< codim >::template Codim< cc >::Entity Dune::cpgrid::Entity< codim >::subEntity ( int  i) const
inherited

◆ type()

GeometryType Dune::cpgrid::Entity< codim >::type ( ) const
inlineinherited

Return marker object (GeometryType object) representing the reference element of the entity. Currently, cube type for all entities (cells and vertices).

Member Data Documentation

◆ pgrid_

const CpGridData* Dune::cpgrid::Entity< codim >::pgrid_
protectedinherited

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