dune-grid  2.6-git
geometrygrid/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_GEOGRID_INTERSECTIONITERATOR_HH
4 #define DUNE_GEOGRID_INTERSECTIONITERATOR_HH
5 
7 
8 namespace Dune
9 {
10 
11  namespace GeoGrid
12  {
13 
14  // IntersectionIterator
15  // --------------------
16 
17  template< class Grid, class HostIntersectionIterator >
18  class IntersectionIterator
19  {
20  typedef typename std::remove_const< Grid >::type::Traits Traits;
21 
22  typedef GeoGrid::Intersection< Grid, typename HostIntersectionIterator::Intersection > IntersectionImpl;
23 
24  typedef typename Traits::template Codim< 0 >::Geometry ElementGeometry;
25  typedef typename Traits::template Codim< 0 >::GeometryImpl ElementGeometryImpl;
26 
27  public:
29 
31  {}
32 
33  template< class Entity >
34  IntersectionIterator ( const Entity &inside,
35  const HostIntersectionIterator &hostIterator )
36  : hostIterator_( hostIterator )
37  , insideGeo_( Grid::getRealImplementation( inside.geometry() ) )
38  {}
39 
41  : hostIterator_( other.hostIterator_ )
42  , insideGeo_( other.insideGeo_ )
43  {}
44 
46  : hostIterator_( std::move( other.hostIterator_ ) )
47  , insideGeo_( std::move( other.insideGeo_ ) )
48  {}
49 
51  {
52  hostIterator_ = other.hostIterator_;
53  insideGeo_ = other.insideGeo_;
54  return *this;
55  }
56 
58  {
59  hostIterator_ = std::move( other.hostIterator_ );
60  insideGeo_ = std::move( other.insideGeo_ );
61  return *this;
62  }
63 
64  bool equals ( const IntersectionIterator &other ) const
65  {
66  return (hostIterator_ == other.hostIterator_);
67  }
68 
69  void increment ()
70  {
71  ++hostIterator_;
72  }
73 
75  {
76  return IntersectionImpl( *hostIterator_, insideGeo_ );
77  }
78 
79  private:
80 
81  HostIntersectionIterator hostIterator_;
82  ElementGeometryImpl insideGeo_;
83 
84  };
85 
86  } // namespace GeoGrid
87 
88 } // namespace Dune
89 
90 #endif // #ifndef DUNE_GEOGRID_INTERSECTIONITERATOR_HH
Dune::GeoGrid::IntersectionIterator::equals
bool equals(const IntersectionIterator &other) const
Definition: geometrygrid/intersectioniterator.hh:64
Dune::GeoGrid::IntersectionIterator::IntersectionIterator
IntersectionIterator(IntersectionIterator &&other)
Definition: geometrygrid/intersectioniterator.hh:45
intersection.hh
Dune::Grid
Grid abstract base class.
Definition: common/grid.hh:373
Dune::GeoGrid::IntersectionIterator::IntersectionIterator
IntersectionIterator(const Entity &inside, const HostIntersectionIterator &hostIterator)
Definition: geometrygrid/intersectioniterator.hh:34
Dune::GeoGrid::Entity
DUNE-conform implementation of the entity.
Definition: geometrygrid/entity.hh:47
Dune::GeoGrid::IntersectionIterator::dereference
Intersection dereference() const
Definition: geometrygrid/intersectioniterator.hh:74
Dune::GeoGrid::IntersectionIterator::Intersection
Dune::Intersection< Grid, IntersectionImpl > Intersection
Definition: geometrygrid/intersectioniterator.hh:28
Dune::Intersection
Intersection of a mesh entity of codimension 0 ("element") with a "neighboring" element or with the d...
Definition: common/grid.hh:344
Dune::GeoGrid::IntersectionIterator
Definition: geometrygrid/entity.hh:58
Dune::GeoGrid::IntersectionIterator::IntersectionIterator
IntersectionIterator(const IntersectionIterator &other)
Definition: geometrygrid/intersectioniterator.hh:40
Dune
Include standard header files.
Definition: agrid.hh:58
Dune::GeoGrid::IntersectionIterator::IntersectionIterator
IntersectionIterator()
Definition: geometrygrid/intersectioniterator.hh:30
Dune::GeoGrid::Intersection
Definition: geometrygrid/intersection.hh:19
Dune::GeoGrid::IntersectionIterator::increment
void increment()
Definition: geometrygrid/intersectioniterator.hh:69
Dune::GeoGrid::IntersectionIterator::operator=
IntersectionIterator & operator=(const IntersectionIterator &other)
Definition: geometrygrid/intersectioniterator.hh:50