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
7
* \brief The YaspIntersectionIterator class
9
YaspIntersectionIterator enables iteration over intersections with
10
neighboring codim 0 entities.
15
/** \brief YaspIntersectionIterator enables iteration over intersections with
16
neighboring codim 0 entities.
18
template<class GridImp>
19
class YaspIntersectionIterator
21
enum { dim=GridImp::dimension };
22
YaspIntersectionIterator();
24
// types used from grids
25
typedef Dune::Intersection< GridImp, Dune::YaspIntersection< GridImp > > Intersection;
26
typedef MakeableInterfaceObject<Intersection> MakeableIntersection;
31
GridImp::getRealImplementation(intersection_)._count += (GridImp::getRealImplementation(intersection_)._count < 2*dim);
35
bool equals (const YaspIntersectionIterator& other) const
37
return GridImp::getRealImplementation(intersection_)._inside.equals(GridImp::getRealImplementation(other.intersection_)._inside)
38
and (GridImp::getRealImplementation(intersection_)._count == GridImp::getRealImplementation(other.intersection_)._count);
41
//! \brief dereferencing
42
const Intersection & dereference() const
47
//! make intersection iterator from entity
48
YaspIntersectionIterator (const YaspEntity<0,dim,GridImp>& myself, bool toend)
49
: intersection_(MakeableIntersection(YaspIntersection<GridImp>(myself, toend)))
53
YaspIntersectionIterator (const YaspIntersectionIterator& other)
54
: intersection_(other.intersection_)
58
YaspIntersectionIterator & operator = (const YaspIntersectionIterator& other)
60
GridImp::getRealImplementation(intersection_).assign(
61
GridImp::getRealImplementation(other.intersection_));
66
// The intersection this iterator points to
67
mutable MakeableIntersection intersection_;
72
#endif // DUNE_GRID_YASPGRIDINTERSECTIONITERATOR_HH