3#ifndef DUNE_ALU2DGRID_ITERATOR_HH
4#define DUNE_ALU2DGRID_ITERATOR_HH
19 template<
int cd,
int dim,
class Gr
idImp>
20 class ALU2dGridEntity;
21 template<
int cd, PartitionIteratorType pitype,
class Gr
idImp >
22 class ALU2dGridLevelIterator;
23 template<
int cd,
class Gr
idImp >
24 class ALU2dGridEntityPointer;
25 template<
int mydim,
int coorddim,
class Gr
idImp>
26 class ALU2dGridGeometry;
27 template<
class Gr
idImp>
28 class ALU2dGridHierarchicIterator;
29 template<
class Gr
idImp>
30 class ALU2dGridIntersectionBase;
31 template<
class Gr
idImp>
32 class ALU2dGridLeafIntersectionIterator;
33 template<
class Gr
idImp>
34 class ALU2dGridLevelIntersectionIterator;
35 template<
int codim, PartitionIteratorType pitype,
class Gr
idImp>
36 class ALU2dGridLeafIterator;
37 template<
int dim,
int dimworld, ALU2DSPACE ElementType eltype >
48 template<
int cdim, PartitionIteratorType pitype,
class Gr
idImp>
49 class ALU2dGridLeafIterator
50 :
public ALU2dGridEntityPointer<cdim,GridImp>
53 static const int dim = GridImp::dimension;
54 static const int dimworld = GridImp::dimensionworld;
55 static const ALU2DSPACE ElementType eltype = GridImp::elementType;
56 static const int codim = cdim;
58 friend class ALU2dGridEntity<0,dimworld,GridImp>;
59 friend class ALU2dGridEntity<1,dimworld,GridImp>;
60 friend class ALU2dGridEntity<dim,dimworld,GridImp>;
61 friend class ALU2dGrid< dim, dimworld, eltype >;
63 typedef ALU2dGridEntityPointer<cdim,GridImp> EntityPointerType;
64 typedef ALU2dGridEntity<cdim,dim,GridImp> EntityImp;
66 typedef ALU2dGridLeafIterator<cdim, pitype, GridImp> ThisType;
68 typedef typename GridImp :: ALU2dGridLeafMarkerVectorType LeafMarkerVectorType;
71 template <
class ElementImp,
class MarkerVectorImp,
int codim>
75 static int level(
const ElementImp & elem,
const MarkerVectorImp& marker)
82 template <
class ElementImp,
class MarkerVectorImp>
83 struct GetLevel<ElementImp,MarkerVectorImp,2>
86 static int level(
const ElementImp & elem,
const MarkerVectorImp& marker)
88 return marker.levelOfVertex(elem.getIndex());
93 typedef typename GridImp :: GridObjectFactoryType FactoryType;
96 typedef typename GridImp::template Codim<cdim>::Entity Entity;
100 ALU2dGridLeafIterator(
const FactoryType& factory,
bool end);
103 ALU2dGridLeafIterator(
const ThisType & org);
109 ThisType & operator = (
const ThisType & org);
117 typedef ALU2DSPACE Listwalkptr< ElementType > IteratorType;
122 LeafMarkerVectorType & marker_;
133 template<PartitionIteratorType pitype,
class Gr
idImp>
134 class ALU2dGridLeafIterator<1,pitype,GridImp>
135 :
public ALU2dGridEntityPointer<1,GridImp>
138 static const int dim = GridImp::dimension;
139 static const int dimworld = GridImp::dimensionworld;
140 static const ALU2DSPACE ElementType eltype = GridImp::elementType;
141 static const int codim = 1;
143 friend class ALU2dGridEntity<0,dimworld,GridImp>;
144 friend class ALU2dGridEntity<1,dimworld,GridImp>;
145 friend class ALU2dGridEntity<dim,dimworld,GridImp>;
146 friend class ALU2dGrid< dim, dimworld, eltype >;
148 typedef ALU2dGridEntityPointer<1,GridImp> EntityPointerType;
149 typedef ALU2dGridEntity<1,dim,GridImp> EntityImp;
151 typedef ALU2dGridLeafIterator<1, pitype, GridImp> ThisType;
153 typedef typename GridImp :: ALU2dGridLeafMarkerVectorType LeafMarkerVectorType;
156 typedef typename GridImp :: GridObjectFactoryType FactoryType;
159 typedef typename GridImp::template Codim<1>::Entity Entity;
163 ALU2dGridLeafIterator(
const FactoryType& factory,
bool end);
166 ALU2dGridLeafIterator(
const ThisType & org);
172 ThisType & operator = (
const ThisType & org);
187 typedef ALU2DSPACE Listwalkptr< ElementType > IteratorType;
193 LeafMarkerVectorType & marker_;
203 template<PartitionIteratorType pitype,
class Gr
idImp>
204 class ALU2dGridLevelIterator<0, pitype, GridImp>
205 :
public ALU2dGridEntityPointer<0,GridImp>
208 static const int dim = GridImp::dimension;
209 static const int dimworld = GridImp::dimensionworld;
210 static const ALU2DSPACE ElementType eltype = GridImp::elementType;
211 static const int codim = 0;
213 friend class ALU2dGridEntity<dim,dimworld,GridImp>;
214 friend class ALU2dGridEntity<1,dimworld,GridImp>;
215 friend class ALU2dGridEntity<0,dimworld,GridImp>;
216 friend class ALU2dGrid< dim, dimworld, eltype >;
218 typedef ALU2dGridEntityPointer<codim,GridImp> EntityPointerType;
219 typedef ALU2dGridEntity<codim,dim,GridImp> EntityImp;
221 typedef typename ALU2dImplTraits< dimworld, eltype >::HElementType HElementType;
222 typedef ALU2dGridLevelIterator<0,pitype,GridImp> ThisType;
225 typedef typename GridImp :: GridObjectFactoryType FactoryType;
227 typedef typename GridImp::template Codim<codim>::Entity Entity;
230 ALU2dGridLevelIterator(
const FactoryType& factory,
int level,
bool end);
233 ALU2dGridLevelIterator(
const ThisType & org);
239 ThisType & operator = (
const ThisType & org);
248 HElementType * item_;
252 typedef ALU2DSPACE Listwalkptr< ElementType > IteratorType;
263 template<PartitionIteratorType pitype,
class Gr
idImp>
264 class ALU2dGridLevelIterator<1, pitype, GridImp>
265 :
public ALU2dGridEntityPointer<1,GridImp>
268 static const int dim = GridImp::dimension;
269 static const int dimworld = GridImp::dimensionworld;
270 static const ALU2DSPACE ElementType eltype = GridImp::elementType;
271 static const int codim = 1;
273 friend class ALU2dGridEntity<dim,dimworld,GridImp>;
274 friend class ALU2dGridEntity<1,dimworld,GridImp>;
275 friend class ALU2dGridEntity<0,dimworld,GridImp>;
276 friend class ALU2dGrid< dim, dimworld, eltype >;
278 typedef ALU2dGridEntityPointer<codim,GridImp> EntityPointerType;
279 typedef ALU2dGridEntity<codim,dim,GridImp> EntityImp;
281 typedef typename ALU2dImplTraits< dimworld, eltype >::HElementType HElementType;
283 typedef ALU2dGridLevelIterator<1,pitype,GridImp> ThisType;
285 typedef typename GridImp :: GridObjectFactoryType FactoryType;
287 typedef typename GridImp::template Codim<codim>::Entity Entity;
290 ALU2dGridLevelIterator(
const FactoryType& factroy,
int level,
bool end);
293 ALU2dGridLevelIterator(
const ThisType & org);
295 ~ALU2dGridLevelIterator();
301 ThisType & operator = (
const ThisType & org);
312 HElementType * item_;
317 typedef ALU2DSPACE Listwalkptr< ElementType > IteratorType;
321 ALU2dGridMarkerVector * marker_;
323 ALU2dGridMarkerVector & marker()
336 template<PartitionIteratorType pitype,
class Gr
idImp>
337 class ALU2dGridLevelIterator<2, pitype, GridImp>
338 :
public ALU2dGridEntityPointer<2,GridImp>
341 static const int dim = GridImp::dimension;
342 static const int dimworld = GridImp::dimensionworld;
343 static const ALU2DSPACE ElementType eltype = GridImp::elementType;
344 static const int codim = 2;
346 friend class ALU2dGridEntity<dim,dimworld,GridImp>;
347 friend class ALU2dGridEntity<1,dimworld,GridImp>;
348 friend class ALU2dGridEntity<0,dimworld,GridImp>;
349 friend class ALU2dGrid< dim, dimworld, eltype >;
351 typedef ALU2dGridEntityPointer<codim,GridImp> EntityPointerType;
352 typedef ALU2dGridEntity<codim,dim,GridImp> EntityImp;
354 typedef typename ALU2dImplTraits< dimworld, eltype >::HElementType HElementType ;
355 typedef ALU2dGridLevelIterator<2,pitype,GridImp> ThisType;
358 typedef typename GridImp :: GridObjectFactoryType FactoryType;
360 typedef typename GridImp::template Codim<codim>::Entity Entity;
363 ALU2dGridLevelIterator(
const FactoryType& factory,
int level,
bool end);
366 ALU2dGridLevelIterator(
const ThisType & org);
368 ~ALU2dGridLevelIterator();
374 ThisType & operator = (
const ThisType & org);
389 HElementType * item_;
390 VertexType * vertex_;
393 typedef ALU2DSPACE Listwalkptr< ElementType > IteratorType;
397 ALU2dGridMarkerVector * marker_;
398 ALU2dGridMarkerVector & marker()
412 template<
class Gr
idImp>
419 static const int dim = GridImp::dimension;
420 static const int dimworld = GridImp::dimensionworld;
421 static const ALU2DSPACE ElementType eltype = GridImp::elementType;
422 static const int codim = 2;
424 typedef typename ALU2dImplTraits< dimworld, eltype >::HElementType HElementType ;
427 typedef typename GridImp :: GridObjectFactoryType FactoryType;
432 typedef typename GridImp::ctype
ctype;
438 const HElementType & elem,
int maxlevel,
bool end=
false);
451 maxlevel_= org.maxlevel_;
452 endIter_ = org.endIter_;
459 HElementType * goNextElement (HElementType * oldEl);
462 const HElementType * elem_;
472#include "iterator_imp.cc"
Definition: entity.hh:549
ThisType & operator=(const ThisType &org)
assigment operator
Definition: entity.hh:212
Hierarchic Iterator of ALU2dGrid.
Definition: iterator.hh:416
ThisType & operator=(const ALU2dGridHierarchicIterator< GridImp > &org)
the assignment operator
Definition: iterator.hh:447
GridImp::template Codim< 0 >::Entity Entity
type of entities we iterate
Definition: iterator.hh:430
void increment()
increment, go to next entity
ALU2dGridEntity< 0, dim, GridImp > EntityImp
tpye of entity implementation
Definition: iterator.hh:434
ALU2dGridHierarchicIterator(const FactoryType &factory, const HElementType &elem, int maxlevel, bool end=false)
the normal Constructor
ALU2dGridHierarchicIterator(const ALU2dGridHierarchicIterator< GridImp > &org)
the normal Constructor
GridImp::ctype ctype
type of coordinates, i.e. double
Definition: iterator.hh:432
Different resources needed by all grid implementations.
Provides proxy classes for IntersectionsIterators.
Dune namespace.
Definition: alignment.hh:10
Static tag representing a codimension.
Definition: dimension.hh:22