dune-fem 2.8.0
Loading...
Searching...
No Matches
geometrygridpart/intersectioniterator.hh
Go to the documentation of this file.
1#ifndef DUNE_FEM_GRIDPART_GEOMETRYGRIDPART_INTERSECTIONITERATOR_HH
2#define DUNE_FEM_GRIDPART_GEOMETRYGRIDPART_INTERSECTIONITERATOR_HH
3
4#include <type_traits>
5
6#include <dune/grid/common/intersectioniterator.hh>
7
9
10namespace Dune
11{
12
13 namespace Fem
14 {
15
16 // GeometryGridPartIntersectionIterator
17 // ------------------------------------
18
19 template< class GridFamily >
21 {
23
24 typedef typename std::remove_const_t< GridFamily >::Traits Traits;
25
26 typedef typename Traits::HostGridPartType::IntersectionIteratorType HostIntersectionIteratorType;
27
28 typedef typename Traits::template Codim< 0 >::Entity Entity;
29 typedef typename Traits::template Codim< 0 >::Geometry ElementGeometry;
30
31 typedef typename Traits::GridFunctionType GridFunctionType;
32
34
35 public:
36 typedef Dune::Intersection< const GridFamily, IntersectionImplType > Intersection;
37
39
40 GeometryGridPartIntersectionIterator ( const Entity &inside, const HostIntersectionIteratorType &hostIterator )
41 : hostIterator_( hostIterator ), gridFunction_( &inside.impl().gridFunction() ), insideGeo_( inside.geometry().impl() )
42 {}
43
44 bool equals ( const ThisType &other ) const { return (hostIterator_ == other.hostIterator_); }
45
46 void increment () { ++hostIterator_; }
47
48 Intersection dereference () const { return IntersectionImplType( *gridFunction_, insideGeo_, *hostIterator_ ); }
49
50 private:
51 HostIntersectionIteratorType hostIterator_;
52 const GridFunctionType *gridFunction_ = nullptr;
53 typename ElementGeometry::Implementation insideGeo_;
54 };
55
56 } // namespace Fem
57
58} // namespace Dune
59
60#endif // #ifndef DUNE_FEM_GRIDPART_GEOMETRYGRIDPART_INTERSECTIONITERATOR_HH
Definition: bindguard.hh:11
Definition: geometrygridpart/intersection.hh:23
Definition: geometrygridpart/intersectioniterator.hh:21
void increment()
Definition: geometrygridpart/intersectioniterator.hh:46
Intersection dereference() const
Definition: geometrygridpart/intersectioniterator.hh:48
Dune::Intersection< const GridFamily, IntersectionImplType > Intersection
Definition: geometrygridpart/intersectioniterator.hh:36
bool equals(const ThisType &other) const
Definition: geometrygridpart/intersectioniterator.hh:44
GeometryGridPartIntersectionIterator(const Entity &inside, const HostIntersectionIteratorType &hostIterator)
Definition: geometrygridpart/intersectioniterator.hh:40