Dune Core Modules (2.7.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::Entity::dimension;
32
33 struct Begin {};
34 struct End {};
35
36 private:
37 typedef AlbertaGridLeafIntersection< GridImp > IntersectionImp;
38
39 public:
40 AlbertaGridLeafIntersectionIterator ()
41 {}
42
43 template< class EntityImp >
44 AlbertaGridLeafIntersectionIterator ( const EntityImp &entity, Begin )
45 : intersection_( IntersectionImp( entity, 0 ) )
46 {}
47
48 template< class EntityImp >
49 AlbertaGridLeafIntersectionIterator ( const EntityImp &entity, End )
50 : intersection_( IntersectionImp( entity, dimension+1 ) )
51 {}
52
53 AlbertaGridLeafIntersectionIterator ( const This &other )
54 : intersection_( other.intersection_.impl() )
55 {}
56
57 This &operator= ( const This &other )
58 {
59 intersection_.impl() = other.intersection_.impl();
60 return *this;
61 }
62
63 const Intersection &dereference () const
64 {
65 return intersection_;
66 }
67
68 bool equals ( const This &other ) const
69 {
70 return (intersection_.impl() == other.intersection_.impl());
71 }
72
73 void increment ()
74 {
75 intersection_.impl().next();
76 }
77
78 private:
79 Intersection intersection_;
80 };
81
82}
83
84#endif // #if HAVE_ALBERTA
85
86#endif // #ifndef DUNE_ALBERTA_INTERSECTIONITERATOR_HH
Intersection of a mesh entity of codimension 0 ("element") with a "neighboring" element or with the d...
Definition: intersection.hh:162
constexpr auto equals(T1 &&t1, T2 &&t2)
Equality comparison.
Definition: hybridutilities.hh:401
Dune namespace.
Definition: alignedallocator.hh:14
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 12, 23:30, 2024)