iterator.hh
Go to the documentation of this file.
1// -*- mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2// vi: set et ts=2 sw=2 sts=2:
3#ifndef DUNE_POLYHEDRALGRID_ITERATOR_HH
4#define DUNE_POLYHEDRALGRID_ITERATOR_HH
5
6#include <dune/geometry/referenceelements.hh>
7
8#include <dune/grid/common/entityiterator.hh>
9
11
12namespace Dune
13{
14
15 // PolyhedralGridIterator
16 // --------------
17
18 template< int codim, class Grid, PartitionIteratorType pitype >
20 : public PolyhedralGridEntityPointer< codim, Grid >
21 {
24
25 protected:
26 typedef typename Base::ExtraData ExtraData;
27 using Base :: entityImpl;
28
29 public:
30 typedef typename Grid::Traits::template Codim<codim>::EntitySeed EntitySeed;
31 typedef typename Grid::Traits::template Codim<codim>::EntityImpl EntityImpl;
32
33 PolyhedralGridIterator ( ExtraData data, const bool beginIterator )
34 : Base( data )
35 {
36 if( beginIterator )
38 }
39
41 void increment ()
42 {
43 int index = entityImpl().seed().index();
44 ++index;
45
46 if( index >= entityImpl().data()->size( codim ) )
48 else
49 entityImpl() = EntityImpl( entityImpl().data(), EntitySeed( index ) );
50 }
51 };
52
53} // namespace Dune
54
55#endif // #ifndef DUNE_POLYHEDRALGRID_ITERATOR_HH
Definition: entitypointer.hh:19
EntityImpl & entityImpl() const
Definition: entitypointer.hh:77
ExtraData data() const
Definition: entitypointer.hh:82
Traits::ExtraData ExtraData
Definition: entitypointer.hh:35
Definition: iterator.hh:21
Grid::Traits::template Codim< codim >::EntitySeed EntitySeed
Definition: iterator.hh:30
void increment()
increment
Definition: iterator.hh:41
PolyhedralGridIterator(ExtraData data, const bool beginIterator)
Definition: iterator.hh:33
Base::ExtraData ExtraData
Definition: iterator.hh:26
Grid::Traits::template Codim< codim >::EntityImpl EntityImpl
Definition: iterator.hh:31
The namespace Dune is the main namespace for all Dune code.
Definition: common/CartesianIndexMapper.hpp:10