DUNE MultiDomainGrid (2.8)

hierarchiciterator.hh
1#ifndef DUNE_MULTIDOMAINGRID_HIERARCHICITERATOR_HH
2#define DUNE_MULTIDOMAINGRID_HIERARCHICITERATOR_HH
3
4namespace Dune {
5
6namespace mdgrid {
7
8template<int codim, int dim, typename GridImp>
9class EntityWrapper;
10
11template<typename GridImp>
12class HierarchicIteratorWrapper
13{
14
15public:
16
17 static const int codimension = 0;
18
19 using Entity = typename GridImp::template Codim<0>::Entity;
20 using EntityWrapper = Dune::mdgrid::EntityWrapper<0,GridImp::dimension,GridImp>;
21 using HostIterator = typename GridImp::HostGrid::HierarchicIterator;
22
23 HierarchicIteratorWrapper() = default;
24
25 explicit HierarchicIteratorWrapper(const HostIterator& hostIterator)
26 : _hostIterator(hostIterator)
27 {}
28
29 void increment() {
30 ++_hostIterator;
31 }
32
33 bool equals(const HierarchicIteratorWrapper& r) const
34 {
35 return _hostIterator == r._hostIterator;
36 }
37
38 Entity dereference() const
39 {
40 return {EntityWrapper(*_hostIterator)};
41 }
42
43 int level() const
44 {
45 return _hostIterator.level();
46 }
47
48private:
49
50 HostIterator _hostIterator;
51
52};
53
54} // namespace mdgrid
55
56} // namespace Dune
57
58#endif // DUNE_MULTIDOMAINGRID_HIERARCHICITERATOR_HH
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden & Uni Heidelberg  |  generated with Hugo v0.111.3 (Apr 4, 22:59, 2025)