intersectioniterator.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_INTERSECTIONITERATOR_HH
4#define DUNE_POLYHEDRALGRID_INTERSECTIONITERATOR_HH
5
7
8namespace Dune
9{
10
11 // PolyhedralGridIntersectionIterator
12 // --------------------------
13
14 template< class Grid >
16 {
17 protected:
19
20 typedef typename Grid::Traits Traits;
21 typedef typename Traits::template Codim<0>::Entity Element;
22 static const bool isLeafIntersection = true;
23
24 public:
25 typedef typename Traits::template Codim<0>::EntitySeed EntitySeed;
26
27 typedef typename std::conditional< isLeafIntersection,
28 typename Traits :: LeafIntersection,
29 typename Traits :: LevelIntersection > :: type Intersection ;
30 typedef typename Intersection :: Implementation IntersectionImpl ;
31
32 typedef typename Traits :: ExtraData ExtraData;
33
34 typedef typename Grid::template Codim< 0 >::EntityPointer EntityPointer;
35
37 : intersection_( IntersectionImpl( data, seed, isBegin?0:data->subEntities(seed, 1) ) )
38 {}
39
42 {}
43
45 {
47 return *this;
48 }
49
50 bool equals ( const This &other ) const
51 {
52 return intersectionImpl().equals( other.intersectionImpl() );
53 }
54
55 void increment ()
56 {
57 ++(intersectionImpl()).intersectionIdx_;
58 }
59
60 const Intersection &dereference () const
61 {
62 return intersection_;
63 }
64
65 ExtraData data() const { return intersectionImpl().data(); }
66
67 protected:
69 {
70 return intersection_.impl();
71 }
72
74 };
75
76} // namespace Dune
77
78#endif // #ifndef DUNE_POLYHEDRALGRID_INTERSECTIONITERATOR_HH
Definition: intersectioniterator.hh:16
Traits::template Codim< 0 >::Entity Element
Definition: intersectioniterator.hh:21
Traits::ExtraData ExtraData
Definition: intersectioniterator.hh:32
ExtraData data() const
Definition: intersectioniterator.hh:65
PolyhedralGridIntersectionIterator & operator=(const This &other)
Definition: intersectioniterator.hh:44
Grid::template Codim< 0 >::EntityPointer EntityPointer
Definition: intersectioniterator.hh:34
PolyhedralGridIntersectionIterator< Grid > This
Definition: intersectioniterator.hh:18
IntersectionImpl & intersectionImpl() const
Definition: intersectioniterator.hh:68
Intersection::Implementation IntersectionImpl
Definition: intersectioniterator.hh:30
const Intersection & dereference() const
Definition: intersectioniterator.hh:60
static const bool isLeafIntersection
Definition: intersectioniterator.hh:22
PolyhedralGridIntersectionIterator(const This &other)
Definition: intersectioniterator.hh:40
Grid::Traits Traits
Definition: intersectioniterator.hh:20
Traits::template Codim< 0 >::EntitySeed EntitySeed
Definition: intersectioniterator.hh:25
void increment()
Definition: intersectioniterator.hh:55
PolyhedralGridIntersectionIterator(ExtraData data, const EntitySeed &seed, bool isBegin)
Definition: intersectioniterator.hh:36
std::conditional< isLeafIntersection, typenameTraits::LeafIntersection, typenameTraits::LevelIntersection >::type Intersection
Definition: intersectioniterator.hh:29
Intersection intersection_
Definition: intersectioniterator.hh:73
bool equals(const This &other) const
Definition: intersectioniterator.hh:50
The namespace Dune is the main namespace for all Dune code.
Definition: common/CartesianIndexMapper.hpp:10