Dune Core Modules (2.5.0)

yaspgridintersectioniterator.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_GRID_YASPGRIDINTERSECTIONITERATOR_HH
4#define DUNE_GRID_YASPGRIDINTERSECTIONITERATOR_HH
5
13namespace Dune {
14
18 template<class GridImp>
20 {
21 enum { dim=GridImp::dimension };
22 public:
23 // types used from grids
26
28 void increment()
29 {
30 GridImp::getRealImplementation(intersection_)._count += (GridImp::getRealImplementation(intersection_)._count < 2*dim);
31 }
32
34 bool equals (const YaspIntersectionIterator& other) const
35 {
36 return intersection_ == other.intersection_;
37 }
38
40 const Intersection & dereference() const
41 {
42 GridImp::getRealImplementation(intersection_).update();
43 return intersection_;
44 }
45
47 {}
48
50 YaspIntersectionIterator (const YaspEntity<0,dim,GridImp>& myself, bool toend)
51 : intersection_(IntersectionImp(myself, toend))
52 {}
53
56 : intersection_(other.intersection_)
57 {}
58
61 {
62 intersection_ = other.intersection_;
63 return *this;
64 }
65
66 private:
67 // The intersection this iterator points to
68 mutable Intersection intersection_;
69 };
70
71} // namespace Dune
72
73#endif // DUNE_GRID_YASPGRIDINTERSECTIONITERATOR_HH
Intersection of a mesh entity of codimension 0 ("element") with a "neighboring" element or with the d...
Definition: intersection.hh:162
YaspIntersectionIterator enables iteration over intersections with neighboring codim 0 entities.
Definition: yaspgridintersectioniterator.hh:20
const Intersection & dereference() const
dereferencing
Definition: yaspgridintersectioniterator.hh:40
YaspIntersectionIterator(const YaspIntersectionIterator &other)
copy constructor
Definition: yaspgridintersectioniterator.hh:55
void increment()
increment
Definition: yaspgridintersectioniterator.hh:28
YaspIntersectionIterator & operator=(const YaspIntersectionIterator &other)
assignment
Definition: yaspgridintersectioniterator.hh:60
YaspIntersectionIterator(const YaspEntity< 0, dim, GridImp > &myself, bool toend)
make intersection iterator from entity
Definition: yaspgridintersectioniterator.hh:50
bool equals(const YaspIntersectionIterator &other) const
equality
Definition: yaspgridintersectioniterator.hh:34
YaspIntersection provides data about intersection with neighboring codim 0 entities.
Definition: yaspgridintersection.hh:20
Dune namespace.
Definition: alignment.hh:11
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 23, 23:29, 2024)