Dune Core Modules (2.3.1)

intersectioniterator.hh
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_GRID_INTERSECTIONITERATOR_HH
4#define DUNE_GRID_INTERSECTIONITERATOR_HH
5
7
8#include <dune/grid/common/intersection.hh>
9
10namespace Dune
11{
12
81 template< class GridImp, class IntersectionIteratorImp, class IntersectionImp >
83 {
84#if DUNE_GRID_EXPERIMENTAL_GRID_EXTENSIONS
85 public:
86#else
87 protected:
88 // give the GridDefaultImplementation class access to the realImp
89 friend class GridDefaultImplementation<
90 GridImp::dimension, GridImp::dimensionworld,
91 typename GridImp::ctype,
92 typename GridImp::GridFamily> ;
93#endif
94 // type of underlying implementation, for internal use only
95 typedef IntersectionIteratorImp Implementation;
96
98 Implementation &impl () { return realIterator; }
100 const Implementation &impl () const { return realIterator; }
101
102 protected:
103 Implementation realIterator;
104
105 public:
108
109 //===========================================================
113 //===========================================================
114
116 const Intersection & operator*() const
117 {
118 return this->realIterator.dereference();
119 }
120
122 const Intersection * operator->() const
123 {
124 return & this->realIterator.dereference();
125 }
127
128
129 //===========================================================
133 //===========================================================
134
140 bool operator==(const IntersectionIterator& rhs) const
141 {
142 return rhs.equals(*this);
143 }
144
150 bool operator!=(const IntersectionIterator& rhs) const
151 {
152 return ! rhs.equals(*this);
153 }
155
158 {
159 this->realIterator.increment();
160 return *this;
161 }
162
163 //===========================================================
167 //===========================================================
168
170 bool equals(const IntersectionIterator& rhs) const
171 {
172 return this->realIterator.equals(rhs.realIterator);
173 }
174
176 IntersectionIterator ( const Implementation &impl )
177 : realIterator( impl )
178 {}
179
182 realIterator(i.realIterator) {}
184 };
185
186} // namespace Dune
187
188#include "intersection.hh"
189
190#endif // DUNE_GRID_INTERSECTIONITERATOR_HH
Definition: grid.hh:1017
Mesh entities of codimension 0 ("elements") allow to visit all intersections with "neighboring" eleme...
Definition: intersectioniterator.hh:83
const Intersection * operator->() const
Pointer operator.
Definition: intersectioniterator.hh:122
IntersectionIterator & operator++()
Preincrement operator. Proceed to next intersection.
Definition: intersectioniterator.hh:157
IntersectionIterator(const IntersectionIterator &i)
Definition: intersectioniterator.hh:181
const Intersection & operator*() const
Dereferencing operator.
Definition: intersectioniterator.hh:116
bool operator==(const IntersectionIterator &rhs) const
Checks for equality. Only Iterators pointing to the same intersection from the same Entity are equal....
Definition: intersectioniterator.hh:140
Dune::Intersection< GridImp, IntersectionImp > Intersection
Type of Intersection this IntersectionIterator points to.
Definition: intersectioniterator.hh:107
Implementation & impl()
return reference to the real implementation
Definition: intersectioniterator.hh:98
const Implementation & impl() const
return reference to the real implementation
Definition: intersectioniterator.hh:100
bool operator!=(const IntersectionIterator &rhs) const
Checks for inequality. Only Iterators pointing to the same intersection from the same Entity are equa...
Definition: intersectioniterator.hh:150
IntersectionIterator(const Implementation &impl)
Definition: intersectioniterator.hh:176
bool equals(const IntersectionIterator &rhs) const
forward equality check to realIterator
Definition: intersectioniterator.hh:170
Intersection of a mesh entities of codimension 0 ("elements") with a "neighboring" element or with th...
Definition: intersection.hh:161
This file implements iterator facade classes for writing stl conformant iterators.
Dune namespace.
Definition: alignment.hh:14
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 12, 23:30, 2024)