3#ifndef DUNE_ALBERTA_HIERARCHICITERATOR_HH
4#define DUNE_ALBERTA_HIERARCHICITERATOR_HH
7#include <dune/grid/common/entityiterator.hh>
25 template<
class Gr
idImp >
32 typedef typename GridImp::ctype ctype;
35 typedef typename EntityObject::ImplementationType EntityImp;
37 typedef typename EntityImp::ElementInfo ElementInfo;
44 const ElementInfo &elementInfo,
62 return entity_.impl().equals( other.entity_.impl() );
74 return entity_.impl().level();
79 const GridImp &
grid ()
const
81 return entity_.impl().grid();
85 void increment ( ElementInfo elementInfo );
97 template<
class Gr
idImp >
98 inline AlbertaGridHierarchicIterator< GridImp >
99 ::AlbertaGridHierarchicIterator(
const GridImp &grid,
int actLevel,
int maxLevel )
100 : entity_( EntityImp( grid ) ),
101 startLevel_( actLevel ),
102 maxlevel_( maxLevel )
106 template<
class Gr
idImp >
109 const ElementInfo &elementInfo,
111 : entity_( EntityImp( grid ) ),
112 startLevel_( elementInfo.level() ),
113 maxlevel_( maxLevel )
119 template<
class Gr
idImp >
122 : entity_( other.entity_ ),
123 startLevel_( other.startLevel_ ),
124 maxlevel_( other.maxlevel_ )
128 template<
class Gr
idImp >
132 entity_ = other.entity_;
133 startLevel_ = other.startLevel_;
134 maxlevel_ = other.maxlevel_;
139 template<
class Gr
idImp >
142 increment( entity_.impl().elementInfo() );
145 template<
class Gr
idImp >
149 assert( !elementInfo ==
false );
150 if( (elementInfo.level() >= maxlevel_) || elementInfo.isLeaf() )
152 while( (elementInfo.level() > startLevel_) && (elementInfo.indexInFather() == 1) )
153 elementInfo = elementInfo.father();
154 if( elementInfo.level() > startLevel_ )
155 entity_.impl().setElement( elementInfo.father().child( 1 ), 0 );
157 entity_.impl().clearElement();
160 entity_.impl().setElement( elementInfo.child( 0 ), 0 );
Definition: hierarchiciterator.hh:27
Entity & dereference() const
dereferencing
Definition: hierarchiciterator.hh:66
const GridImp & grid() const
obtain a reference to the grid
Definition: hierarchiciterator.hh:79
int level() const
ask for level of entities
Definition: hierarchiciterator.hh:72
void increment()
increment
Definition: hierarchiciterator.hh:140
bool equals(const This &other) const
equality
Definition: hierarchiciterator.hh:60
This & operator=(const This &other)
assignment operator
Definition: hierarchiciterator.hh:130
Wrapper class for entities.
Definition: entity.hh:64
provides a wrapper for ALBERTA's el_info structure
Dune namespace.
Definition: alignedallocator.hh:14
Static tag representing a codimension.
Definition: dimension.hh:22