3#ifndef DUNE_ALBERTA_HIERARCHICITERATOR_HH
4#define DUNE_ALBERTA_HIERARCHICITERATOR_HH
6#include <dune/grid/common/entityiterator.hh>
8#include <dune/grid/albertagrid/entitypointer.hh>
26 template<
class Gr
idImp >
34 typedef typename GridImp::template Codim<0>::Entity Entity;
35 typedef typename GridImp::ctype ctype;
38 typedef typename EntityObject::ImplementationType EntityImp;
40 typedef typename Base::ElementInfo ElementInfo;
44 const ElementInfo &elementInfo,
65 void increment ( ElementInfo elementInfo );
75 template<
class Gr
idImp >
79 startLevel_( actLevel ),
84 template<
class Gr
idImp >
87 const ElementInfo &elementInfo,
90 startLevel_( elementInfo.level() ),
97 template<
class Gr
idImp >
101 startLevel_( other.startLevel_ ),
102 maxlevel_( other.maxlevel_ )
106 template<
class Gr
idImp >
110 Base::operator=( other );
112 startLevel_ = other.startLevel_;
113 maxlevel_ = other.maxlevel_;
118 template<
class Gr
idImp >
121 increment( entityImp().elementInfo() );
124 template<
class Gr
idImp >
128 assert( !elementInfo ==
false );
129 if( (elementInfo.level() >= maxlevel_) || elementInfo.isLeaf() )
131 while( (elementInfo.level() > startLevel_) && (elementInfo.indexInFather() == 1) )
132 elementInfo = elementInfo.father();
133 if( elementInfo.level() > startLevel_ )
134 entityImp().setElement( elementInfo.father().child( 1 ), 0 );
136 entityImp().clearElement();
139 entityImp().setElement( elementInfo.child( 0 ), 0 );
EntityPointer implementation for AlbertaGrid.
Definition: entitypointer.hh:29
const GridImp & grid() const
obtain a reference to the grid
Definition: entitypointer.hh:192
EntityImp & entityImp()
obtain reference to internal entity implementation
Definition: entitypointer.hh:177
int level() const
ask for level of entities
Definition: entitypointer.hh:169
Definition: hierarchiciterator.hh:29
AlbertaGridHierarchicIterator(const GridImp &grid, const ElementInfo &elementInfo, int maxLevel)
the normal Constructor
Definition: hierarchiciterator.hh:86
void increment()
increment
Definition: hierarchiciterator.hh:119
This & operator=(const This &other)
assignment operator
Definition: hierarchiciterator.hh:108
Dune namespace.
Definition: alignment.hh:14