Dune Core Modules (2.6.0)

identitygridhierarchiciterator.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_IDENTITYGRIDHIERITERATOR_HH
4#define DUNE_IDENTITYGRIDHIERITERATOR_HH
5
10namespace Dune {
11
12
13 //**********************************************************************
14 //
22 template<class GridImp>
24 {
25
26 // Type of the corresponding HierarchicIterator in the host grid
27 typedef typename GridImp::HostGridType::template Codim<0>::Entity::HierarchicIterator HostGridHierarchicIterator;
28
29 public:
30
31 enum {codimension = 0};
32
33 typedef typename GridImp::template Codim<0>::Entity Entity;
34
36 explicit IdentityGridHierarchicIterator(const GridImp* identityGrid, const Entity& startEntity, int maxLevel) :
37 identityGrid_(identityGrid),
38 hostHierarchicIterator_(GridImp::getRealImplementation(startEntity).hostEntity_.hbegin(maxLevel))
39 {}
40
41
43 explicit IdentityGridHierarchicIterator(const GridImp* identityGrid, const Entity& startEntity, int maxLevel, bool endDummy) :
44 identityGrid_(identityGrid),
45 hostHierarchicIterator_(GridImp::getRealImplementation(startEntity).hostEntity_.hend(maxLevel))
46 {}
47
48
50 void increment()
51 {
52 ++hostHierarchicIterator_;
53 }
54
56 Entity dereference() const {
57 return Entity{{identityGrid_,*hostHierarchicIterator_}};
58 }
59
62 return hostHierarchicIterator_ == i.hostHierarchicIterator_;
63 }
64
65 private:
66 const GridImp* identityGrid_;
67
68 HostGridHierarchicIterator hostHierarchicIterator_;
69
70 };
71
72
73} // end namespace Dune
74
75#endif
Iterator over the descendants of an entity.Mesh entities of codimension 0 ("elements") allow to visit...
Definition: identitygridhierarchiciterator.hh:24
void increment()
Definition: identitygridhierarchiciterator.hh:50
bool equals(const IdentityGridHierarchicIterator &i) const
equality
Definition: identitygridhierarchiciterator.hh:61
IdentityGridHierarchicIterator(const GridImp *identityGrid, const Entity &startEntity, int maxLevel, bool endDummy)
Definition: identitygridhierarchiciterator.hh:43
Entity dereference() const
dereferencing
Definition: identitygridhierarchiciterator.hh:56
IdentityGridHierarchicIterator(const GridImp *identityGrid, const Entity &startEntity, int maxLevel)
the default Constructor
Definition: identitygridhierarchiciterator.hh:36
Dune namespace.
Definition: alignedallocator.hh:10
Static tag representing a codimension.
Definition: dimension.hh:22
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Dec 26, 23:30, 2024)