dune-fem  2.4.1-rc
idgridpart/intersectioniterator.hh
Go to the documentation of this file.
1 #ifndef DUNE_FEM_GRIDPART_IDGRIDPART_INTERSECTIONITERATOR_HH
2 #define DUNE_FEM_GRIDPART_IDGRIDPART_INTERSECTIONITERATOR_HH
3 
4 #include <type_traits>
5 #include <utility>
6 
7 #include <dune/grid/common/intersectioniterator.hh>
8 
10 
11 namespace Dune
12 {
13 
14  namespace Fem
15  {
16 
17  // IdIntersectionIterator
18  // ----------------------
19 
20  template< class GridFamily >
22  {
24 
25  typedef typename std::remove_const< GridFamily >::type::Traits Traits;
26 
27  typedef typename Traits::HostGridPartType::IntersectionIteratorType HostIntersectionIteratorType;
28 
30 
31  public:
32  typedef Dune::Intersection< const GridFamily, IntersectionImplType > Intersection;
33  typedef typename Traits::ExtraData ExtraData;
34 
35  IdIntersectionIterator () = default;
36 
37  IdIntersectionIterator ( ExtraData data, HostIntersectionIteratorType hostIterator )
38  : data_( std::move( data ) ),
39  hostIterator_( std::move( hostIterator ) )
40  {}
41 
42  bool equals ( const ThisType &other ) const
43  {
44  return hostIterator_ == other.hostIterator_;
45  }
46 
47  void increment ()
48  {
49  ++hostIterator_;
50  }
51 
52  Intersection dereference () const
53  {
54  return IntersectionImplType( data(), *hostIterator_ );
55  }
56 
57  const ExtraData &data () const { return data_; }
58 
59  protected:
60  ExtraData data_;
61  HostIntersectionIteratorType hostIterator_;
62  };
63 
64  } // namespace Fem
65 
66 } // namespace Dune
67 
68 #endif // #ifndef DUNE_FEM_GRIDPART_IDGRIDPART_INTERSECTIONITERATOR_HH
const ExtraData & data() const
Definition: idgridpart/intersectioniterator.hh:57
Definition: idgridpart/intersection.hh:20
void increment()
Definition: idgridpart/intersectioniterator.hh:47
HostIntersectionIteratorType hostIterator_
Definition: idgridpart/intersectioniterator.hh:61
IdIntersectionIterator(ExtraData data, HostIntersectionIteratorType hostIterator)
Definition: idgridpart/intersectioniterator.hh:37
Definition: coordinate.hh:4
ExtraData data_
Definition: idgridpart/intersectioniterator.hh:60
Traits::ExtraData ExtraData
Definition: idgridpart/intersectioniterator.hh:33
STL namespace.
Definition: idgridpart/intersectioniterator.hh:21
void move(ArrayInterface< T > &array, const unsigned int oldOffset, const unsigned int newOffset, const unsigned int length)
Definition: array_inline.hh:38
bool equals(const ThisType &other) const
Definition: idgridpart/intersectioniterator.hh:42
Dune::Intersection< const GridFamily, IntersectionImplType > Intersection
Definition: idgridpart/intersectioniterator.hh:32
Intersection dereference() const
Definition: idgridpart/intersectioniterator.hh:52