DUNE-FEM (unstable)

iterator.hh
1#ifndef DUNE_FEM_GRIDPART_IDGRIDPART_ITERATOR_HH
2#define DUNE_FEM_GRIDPART_IDGRIDPART_ITERATOR_HH
3
4#include <type_traits>
5#include <utility>
6
8#include <dune/grid/common/gridenums.hh>
9
10namespace Dune
11{
12
13 namespace Fem
14 {
15
16 // IdIterator
17 // ----------
18
19 template< int codim, PartitionIteratorType pitype, class GridFamily >
20 class IdIterator
21 {
22 typedef typename std::remove_const< GridFamily >::type::Traits Traits;
23
24 typedef typename Traits::HostGridPartType HostGridPartType;
25
26 public:
27 typedef typename Traits::ExtraData ExtraData;
28 typedef typename HostGridPartType::template Codim< codim >::template Partition< pitype >::IteratorType HostIteratorType;
29
30 typedef typename Traits::template Codim< codim >::Entity Entity;
31
32 IdIterator () = default;
33
34 IdIterator ( ExtraData data, HostIteratorType hostIterator )
35 : data_( std::move( data ) ),
36 hostIterator_( std::move( hostIterator ) )
37 {}
38
39 void increment ()
40 {
41 ++hostIterator_;
42 }
43
44 Entity dereference () const
45 {
46 return typename Entity::Implementation( data_, *hostIterator_ );
47 }
48
49 bool equals ( const IdIterator &rhs ) const
50 {
51 return hostIterator_ == rhs.hostIterator_;
52 }
53
54 int level () const
55 {
56 return hostIterator_.level();
57 }
58
59 private:
60 ExtraData data_;
61 HostIteratorType hostIterator_;
62 };
63
64 } // namespace Fem
65
66} // namespace Dune
67
68#endif // #ifndef DUNE_FEM_GRIDPART_IDGRIDPART_ITERATOR_HH
EntityImp< cd, dim, GridImp > Implementation
type of underlying implementation
Definition: entity.hh:73
Various macros to work with Dune module version numbers.
constexpr auto equals(T1 &&t1, T2 &&t2)
Equality comparison.
Definition: hybridutilities.hh:587
Dune namespace.
Definition: alignedallocator.hh:13
STL namespace.
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 24, 23:30, 2024)