dune-spgrid  2.7
intersectioniterator.hh
Go to the documentation of this file.
1 #ifndef DUNE_SPGRID_INTERSECTIONITERATOR_HH
2 #define DUNE_SPGRID_INTERSECTIONITERATOR_HH
3 
4 #include <type_traits>
5 
7 
8 #include <dune/grid/common/intersectioniterator.hh>
9 
10 namespace Dune
11 {
12 
13  // SPIntersectionIterator
14  // ----------------------
15 
16  template< class Grid >
18  {
20 
21  typedef typename std::remove_const< Grid >::type::Traits Traits;
22 
24 
25  public:
26  typedef Dune::Intersection< Grid, IntersectionImpl > Intersection;
27 
28  typedef typename Intersection::Entity Entity;
29 
32 
33  SPIntersectionIterator () = default;
34 
36  : insideInfo_( insideInfo ), face_( face )
37  {}
38 
39  Intersection dereference () const { return IntersectionImpl( insideInfo(), face_ ); }
40 
41  bool equals ( const This &other ) const
42  {
43  return (face_ == other.face_) && insideInfo().equals( other.insideInfo() );
44  }
45 
46  void increment () { assert( face_ < GridLevel::ReferenceCube::numFaces ); ++face_; }
47 
48  const ElementInfo &insideInfo () const { return insideInfo_; }
49 
50  private:
51  ElementInfo insideInfo_;
52  int face_ = 0;
53  };
54 
55 } // namespace Dune
56 
57 #endif // #ifndef DUNE_SPGRID_INTERSECTIONITERATOR_HH
Definition: iostream.hh:7
Definition: entityinfo.hh:24
bool equals(const This &other) const
Definition: entityinfo.hh:77
Definition: gridlevel.hh:35
Definition: intersection.hh:37
Definition: intersectioniterator.hh:18
Intersection::Entity Entity
Definition: intersectioniterator.hh:28
IntersectionImpl::ElementInfo ElementInfo
Definition: intersectioniterator.hh:30
Intersection dereference() const
Definition: intersectioniterator.hh:39
Dune::Intersection< Grid, IntersectionImpl > Intersection
Definition: intersectioniterator.hh:26
bool equals(const This &other) const
Definition: intersectioniterator.hh:41
void increment()
Definition: intersectioniterator.hh:46
SPIntersectionIterator(const ElementInfo &insideInfo, int face)
Definition: intersectioniterator.hh:35
const ElementInfo & insideInfo() const
Definition: intersectioniterator.hh:48
IntersectionImpl::GridLevel GridLevel
Definition: intersectioniterator.hh:31
static const int numFaces
Definition: referencecube.hh:55