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,
81 return GridImp::getRealImplementation( entity_ );
87 return GridImp::getRealImplementation( entity_ );
91 const GridImp &
grid ()
const
97 void increment ( ElementInfo elementInfo );
109 template<
class Gr
idImp >
110 inline AlbertaGridHierarchicIterator< GridImp >
111 ::AlbertaGridHierarchicIterator(
const GridImp &grid,
int actLevel,
int maxLevel )
112 : entity_( EntityImp( grid ) ),
113 startLevel_( actLevel ),
114 maxlevel_( maxLevel )
118 template<
class Gr
idImp >
121 const ElementInfo &elementInfo,
123 : entity_( EntityImp( grid ) ),
124 startLevel_( elementInfo.level() ),
125 maxlevel_( maxLevel )
131 template<
class Gr
idImp >
134 : entity_( other.entity_ ),
135 startLevel_( other.startLevel_ ),
136 maxlevel_( other.maxlevel_ )
140 template<
class Gr
idImp >
144 entity_ = other.entity_;
145 startLevel_ = other.startLevel_;
146 maxlevel_ = other.maxlevel_;
151 template<
class Gr
idImp >
154 increment( entityImp().elementInfo() );
157 template<
class Gr
idImp >
161 assert( !elementInfo ==
false );
162 if( (elementInfo.level() >= maxlevel_) || elementInfo.isLeaf() )
164 while( (elementInfo.level() > startLevel_) && (elementInfo.indexInFather() == 1) )
165 elementInfo = elementInfo.father();
166 if( elementInfo.level() > startLevel_ )
167 entityImp().setElement( elementInfo.father().child( 1 ), 0 );
169 entityImp().clearElement();
172 entityImp().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:91
int level() const
ask for level of entities
Definition: hierarchiciterator.hh:72
const EntityImp & entityImp() const
obtain const reference to internal entity implementation
Definition: hierarchiciterator.hh:85
void increment()
increment
Definition: hierarchiciterator.hh:152
bool equals(const This &other) const
equality
Definition: hierarchiciterator.hh:60
This & operator=(const This &other)
assignment operator
Definition: hierarchiciterator.hh:142
EntityImp & entityImp()
obtain reference to internal entity implementation
Definition: hierarchiciterator.hh:79
Wrapper class for entities.
Definition: entity.hh:64
provides a wrapper for ALBERTA's el_info structure
Dune namespace.
Definition: alignedallocator.hh:10
Static tag representing a codimension.
Definition: dimension.hh:22