DUNE-FEM (unstable)

intersectioniterator.hh
1#ifndef DUNE_FEM_GRIDPART_FILTEREDGRIDPART_INTERSECTIONITERATOR_HH
2#define DUNE_FEM_GRIDPART_FILTEREDGRIDPART_INTERSECTIONITERATOR_HH
3
4#include <cassert>
5
6#include <type_traits>
7#include <utility>
8
9#include <dune/grid/common/intersectioniterator.hh>
10
11#include <dune/fem/gridpart/filteredgridpart/intersection.hh>
12
13namespace Dune
14{
15
16 namespace Fem
17 {
18
19 // FilteredGridPartIntersectionIterator
20 // ------------------------------------
21
22 template< class GridPartFamily >
23 class FilteredGridPartIntersectionIterator
24 {
25 typedef FilteredGridPartIntersectionIterator< GridPartFamily > ThisType;
26
27 typedef typename std::remove_const_t< GridPartFamily >::Filter FilterType;
28 typedef typename std::remove_const_t< GridPartFamily >::HostGridPart::IntersectionIteratorType HostIteratorType;
29
30 typedef FilteredGridPartIntersection< FilterType, typename HostIteratorType::Intersection > IntersectionImpl;
31
32 public:
34
35 FilteredGridPartIntersectionIterator () = default;
36
37 FilteredGridPartIntersectionIterator ( const FilterType &filter, HostIteratorType hostIterator )
38 : filter_( &filter ), hostIterator_( std::move( hostIterator ) )
39 {}
40
41 Intersection dereference () const { return Intersection( IntersectionImpl( filter(), *hostIterator_ ) ); }
42
43 bool equals ( const ThisType &other ) const { return (hostIterator() == other.hostIterator()); }
44
45 void increment () { ++hostIterator_; }
46
47 const FilterType &filter () const { assert( filter_ ); return *filter_; }
48
49 const HostIteratorType &hostIterator () const { return hostIterator_; }
50 HostIteratorType &hostIterator () { return hostIterator_; }
51
52 private:
53 const FilterType *filter_ = nullptr;
54 HostIteratorType hostIterator_;
55 };
56
57 } // namespace Fem
58
59} // namespace Dune
60
61#endif // #ifndef DUNE_FEM_GRIDPART_FILTEREDGRIDPART_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
Function object for performing equality comparison.
Definition: hybridutilities.hh:572
Dune namespace.
Definition: alignedallocator.hh:13
STL namespace.
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Jul 27, 22:29, 2024)