Dune Core Modules (2.3.1)

intersectioniterator.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_ALBERTA_INTERSECTIONITERATOR_HH
4#define DUNE_ALBERTA_INTERSECTIONITERATOR_HH
5
6#include <dune/grid/common/intersectioniterator.hh>
7
8#include <dune/grid/albertagrid/intersection.hh>
9
15#if HAVE_ALBERTA
16
17namespace Dune
18{
19
20 // AlbertaGridLeafIntersectionIterator
21 // -----------------------------------
22
23 template< class GridImp >
24 class AlbertaGridLeafIntersectionIterator
25 {
26 typedef AlbertaGridLeafIntersectionIterator< GridImp > This;
27
28 public:
30
31 static const int dimension = Intersection::dimension;
32
33 struct Begin {};
34 struct End {};
35
36 private:
37 typedef AlbertaGridLeafIntersection< GridImp > IntersectionImp;
38
39 public:
40 template< class EntityImp >
41 AlbertaGridLeafIntersectionIterator ( const EntityImp &entity, Begin )
42 : intersection_( IntersectionImp( entity, 0 ) )
43 {}
44
45 template< class EntityImp >
46 AlbertaGridLeafIntersectionIterator ( const EntityImp &entity, End )
47 : intersection_( IntersectionImp( entity, dimension+1 ) )
48 {}
49
50 AlbertaGridLeafIntersectionIterator ( const This &other )
51 : intersection_( other.intersectionImp() )
52 {}
53
54 This &operator= ( const This &other )
55 {
56 intersectionImp() = other.intersectionImp();
57 return *this;
58 }
59
60 const Intersection &dereference () const
61 {
62 return intersection_;
63 }
64
65 bool equals ( const This &other ) const
66 {
67 return (intersectionImp() == other.intersectionImp());
68 }
69
70 void increment ()
71 {
72 intersectionImp().next();
73 }
74
75 private:
76 const IntersectionImp &intersectionImp () const
77 {
78 return GridImp::getRealImplementation( intersection_ );
79 }
80
81 IntersectionImp &intersectionImp ()
82 {
83 return GridImp::getRealImplementation( intersection_ );
84 }
85
86 Intersection intersection_;
87 };
88
89}
90
91#endif // #if HAVE_ALBERTA
92
93#endif // #ifndef DUNE_ALBERTA_INTERSECTIONITERATOR_HH
Intersection of a mesh entities of codimension 0 ("elements") with a "neighboring" element or with th...
Definition: intersection.hh:161
Dune namespace.
Definition: alignment.hh:14
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Jul 15, 22:36, 2024)