Dune Core Modules (2.8.0)

identitygridleafiterator.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_IDENTITYGRIDLEAFITERATOR_HH
4#define DUNE_IDENTITYGRIDLEAFITERATOR_HH
5
6#include <dune/grid/common/gridenums.hh>
7
12namespace Dune {
13
14
18 template<int codim, PartitionIteratorType pitype, class GridImp>
20 {
21 private:
22
23 // LevelIterator to the equivalent entity in the host grid
24 typedef typename GridImp::HostGridType::template Codim<codim>::template Partition<pitype>::LeafIterator HostGridLeafIterator;
25
26 public:
27
28 enum {codimension = codim};
29
30 typedef typename GridImp::template Codim<codim>::Entity Entity;
31
33 explicit IdentityGridLeafIterator(const GridImp* identityGrid) :
34 identityGrid_(identityGrid),
35 hostLeafIterator_(identityGrid->hostgrid_->leafGridView().template begin<codim,pitype>())
36 {}
37
42 explicit IdentityGridLeafIterator(const GridImp* identityGrid, [[maybe_unused]] bool endDummy) :
43 identityGrid_(identityGrid),
44 hostLeafIterator_(identityGrid->hostgrid_->leafGridView().template end<codim,pitype>())
45 {}
46
47
49 void increment() {
50 ++hostLeafIterator_;
51 }
52
54 Entity dereference() const {
55 return Entity{{identityGrid_,*hostLeafIterator_}};
56 }
57
59 bool equals(const IdentityGridLeafIterator& i) const {
60 return hostLeafIterator_ == i.hostLeafIterator_;
61 }
62
63 private:
64 const GridImp* identityGrid_;
65
66 HostGridLeafIterator hostLeafIterator_;
67
68 };
69
70
71} // namespace Dune
72
73#endif
Iterator over all entities of a given codimension and level of a grid.
Definition: identitygridleafiterator.hh:20
Entity dereference() const
dereferencing
Definition: identitygridleafiterator.hh:54
bool equals(const IdentityGridLeafIterator &i) const
equality
Definition: identitygridleafiterator.hh:59
IdentityGridLeafIterator(const GridImp *identityGrid, bool endDummy)
Constructor which create the end iterator.
Definition: identitygridleafiterator.hh:42
IdentityGridLeafIterator(const GridImp *identityGrid)
Definition: identitygridleafiterator.hh:33
void increment()
prefix increment
Definition: identitygridleafiterator.hh:49
Grid< dim, dimworld, ct, GridFamily >::LeafGridView leafGridView(const Grid< dim, dimworld, ct, GridFamily > &grid)
leaf grid view for the given grid
Definition: grid.hh:808
Dune namespace.
Definition: alignedallocator.hh:11
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 22, 23:30, 2024)