DUNE-FEM (unstable)

intersectioniterator.hh
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
8#include <dune/fem/gridpart/geometrygridpart/intersection.hh>
9
10namespace Dune
11{
12
13 namespace Fem
14 {
15
16 // GeometryGridPartIntersectionIterator
17 // ------------------------------------
18
19 template< class GridFamily >
20 class GeometryGridPartIntersectionIterator
21 {
22 typedef GeometryGridPartIntersectionIterator< GridFamily > ThisType;
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
33 typedef GeometryGridPartIntersection< const GridFamily > IntersectionImplType;
34
35 public:
37
38 GeometryGridPartIntersectionIterator () = default;
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
Intersection of a mesh entity of codimension 0 ("element") with a "neighboring" element or with the d...
Definition: intersection.hh:164
constexpr auto equals(T1 &&t1, T2 &&t2)
Equality comparison.
Definition: hybridutilities.hh:587
Dune namespace.
Definition: alignedallocator.hh:13
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 13, 23:29, 2024)