Loading [MathJax]/extensions/tex2jax.js

dune-mmesh (1.4)

hierarchiciterator.hh
Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2// vi: set et ts=4 sw=2 sts=2:
3#ifndef DUNE_MMESH_GRID_HIERARCHICITERATOR_HH
4#define DUNE_MMESH_GRID_HIERARCHICITERATOR_HH
5
10namespace Dune
11{
12
13 //**********************************************************************
14 //
22 template<class GridImp>
24 {
25 public:
26 enum {codimension = 0};
27
28 typedef typename GridImp::template Codim<0>::Entity Entity;
29
31 explicit MMeshHierarchicIterator(const GridImp* mMesh, const Entity& startEntity, int maxLevel) :
32 mMesh_(mMesh),
33 i_(0),
34 startEntity_(startEntity)
35 {}
36
38 explicit MMeshHierarchicIterator(const GridImp* mMesh, const Entity& startEntity, int maxLevel, bool endDummy) :
39 mMesh_(mMesh),
40 i_(1),
41 startEntity_(startEntity)
42 {}
43
45 void increment()
46 {
47 ++i_;
48 }
49
51 Entity dereference() const {
52 return startEntity_;
53 }
54
56 bool equals(const MMeshHierarchicIterator& other) const {
57 return startEntity_ == other.startEntity_ && i_ == other.i_;
58 }
59
60 private:
61 const GridImp* mMesh_;
62 int i_;
63 Entity startEntity_;
64
65 };
66
67} // end namespace Dune
68
69#endif
Iterator over the descendants of an entity.Mesh entities of codimension 0 ("elements") allow to visit...
Definition: hierarchiciterator.hh:24
MMeshHierarchicIterator(const GridImp *mMesh, const Entity &startEntity, int maxLevel)
the default constructor of the iterator
Definition: hierarchiciterator.hh:31
bool equals(const MMeshHierarchicIterator &other) const
compare iterators
Definition: hierarchiciterator.hh:56
void increment()
increment iterator
Definition: hierarchiciterator.hh:45
Entity dereference() const
dereference iterator
Definition: hierarchiciterator.hh:51
MMeshHierarchicIterator(const GridImp *mMesh, const Entity &startEntity, int maxLevel, bool endDummy)
the constructor of the end iterator
Definition: hierarchiciterator.hh:38
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden & Uni Heidelberg  |  generated with Hugo v0.111.3 (Apr 13, 22:42, 2025)