Dune Core Modules (2.9.0)

intersectioniterator.hh
1#ifndef DUNE_SPGRID_INTERSECTIONITERATOR_HH
2#define DUNE_SPGRID_INTERSECTIONITERATOR_HH
3
4#include <type_traits>
5
6#include <dune/grid/spgrid/intersection.hh>
7
8#include <dune/grid/common/intersectioniterator.hh>
9
10namespace Dune
11{
12
13 // SPIntersectionIterator
14 // ----------------------
15
16 template< class Grid >
17 class SPIntersectionIterator
18 {
19 typedef SPIntersectionIterator< Grid > This;
20
21 typedef typename std::remove_const< Grid >::type::Traits Traits;
22
23 typedef SPIntersection< Grid > IntersectionImpl;
24
25 public:
27
28 typedef typename Intersection::Entity Entity;
29
30 typedef typename IntersectionImpl::ElementInfo ElementInfo;
31 typedef typename IntersectionImpl::GridLevel GridLevel;
32
33 SPIntersectionIterator () = default;
34
35 SPIntersectionIterator ( const ElementInfo &insideInfo, int face )
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
GridImp::template Codim< 0 >::Entity Entity
Type of entity that this Intersection belongs to.
Definition: intersection.hh:192
constexpr auto equals(T1 &&t1, T2 &&t2)
Equality comparison.
Definition: hybridutilities.hh:402
Dune namespace.
Definition: alignedallocator.hh:13
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Jul 15, 22:36, 2024)