5#ifndef DUNE_ALBERTA_HIERARCHICITERATOR_HH
6#define DUNE_ALBERTA_HIERARCHICITERATOR_HH
9#include <dune/grid/common/entityiterator.hh>
27 template<
class Gr
idImp >
34 typedef typename GridImp::ctype ctype;
37 typedef typename EntityObject::ImplementationType EntityImp;
39 typedef typename EntityImp::ElementInfo ElementInfo;
46 const ElementInfo &elementInfo,
64 return entity_.impl().equals( other.entity_.impl() );
76 return entity_.impl().level();
81 const GridImp &
grid ()
const
83 return entity_.impl().grid();
87 void increment ( ElementInfo elementInfo );
99 template<
class Gr
idImp >
100 inline AlbertaGridHierarchicIterator< GridImp >
101 ::AlbertaGridHierarchicIterator(
const GridImp &grid,
int actLevel,
int maxLevel )
102 : entity_( EntityImp( grid ) ),
103 startLevel_( actLevel ),
104 maxlevel_( maxLevel )
108 template<
class Gr
idImp >
111 const ElementInfo &elementInfo,
113 : entity_( EntityImp( grid ) ),
114 startLevel_( elementInfo.level() ),
115 maxlevel_( maxLevel )
121 template<
class Gr
idImp >
124 : entity_( other.entity_ ),
125 startLevel_( other.startLevel_ ),
126 maxlevel_( other.maxlevel_ )
130 template<
class Gr
idImp >
134 entity_ = other.entity_;
135 startLevel_ = other.startLevel_;
136 maxlevel_ = other.maxlevel_;
141 template<
class Gr
idImp >
144 increment( entity_.impl().elementInfo() );
147 template<
class Gr
idImp >
151 assert( !elementInfo ==
false );
152 if( (elementInfo.level() >= maxlevel_) || elementInfo.isLeaf() )
154 while( (elementInfo.level() > startLevel_) && (elementInfo.indexInFather() == 1) )
155 elementInfo = elementInfo.father();
156 if( elementInfo.level() > startLevel_ )
157 entity_.impl().setElement( elementInfo.father().child( 1 ), 0 );
159 entity_.impl().clearElement();
162 entity_.impl().setElement( elementInfo.child( 0 ), 0 );
Definition: hierarchiciterator.hh:29
Entity & dereference() const
dereferencing
Definition: hierarchiciterator.hh:68
const GridImp & grid() const
obtain a reference to the grid
Definition: hierarchiciterator.hh:81
int level() const
ask for level of entities
Definition: hierarchiciterator.hh:74
void increment()
increment
Definition: hierarchiciterator.hh:142
bool equals(const This &other) const
equality
Definition: hierarchiciterator.hh:62
This & operator=(const This &other)
assignment operator
Definition: hierarchiciterator.hh:132
Wrapper class for entities.
Definition: entity.hh:66
provides a wrapper for ALBERTA's el_info structure
Dune namespace.
Definition: alignedallocator.hh:13
Static tag representing a codimension.
Definition: dimension.hh:24