1#ifndef DUNE_FEM_GRIDPART_FILTEREDGRIDPART_ITERATOR_HH
2#define DUNE_FEM_GRIDPART_FILTEREDGRIDPART_ITERATOR_HH
8#include <dune/grid/common/gridenums.hh>
19 template<
int codim, PartitionIteratorType pitype,
class Gr
idPartImp >
20 class FilteredGridPartIterator
22 typedef FilteredGridPartIterator< codim, pitype, GridPartImp > ThisType;
24 typedef GridPartImp GridPartType;
25 typedef typename GridPartType::HostGridPartType HostGridPartType;
26 typedef typename HostGridPartType::template Codim< codim >::template Partition< pitype >::IteratorType HostIteratorType;
30 typedef typename HostIteratorType::Entity Entity;
32 static const int codimension = codim;
35 FilteredGridPartIterator (
const GridPartType &gridPart,
const HostIteratorType &hostIterator )
36 : gridPart_( gridPart ),
37 hostIterator_( hostIterator ),
38 hostEnd_( gridPart.hostGridPart().template end< codim, pitype >() )
43 if( !gridPart.contains( *hostIterator_ ) )
48 FilteredGridPartIterator (
const ThisType &other )
49 : gridPart_( other.gridPart_ ),
50 hostIterator_( other.hostIterator_ ),
51 hostEnd_( other.hostEnd_ )
55 ThisType &operator= (
const ThisType &other )
57 assert( &gridPart_ == &other.gridPart_ );
58 hostIterator_ = other.hostIterator_;
59 hostEnd_ = other.hostEnd_;
67 do { ++hostIterator_; }
while ( !done() && !
contains() );
71 int level ()
const {
return hostIterator_.level(); }
74 Entity dereference ()
const {
return *hostIterator_; }
77 bool equals (
const ThisType &other )
const
79 return hostIterator_ == other.hostIterator_;
85 return (hostIterator_ == hostEnd_);
91 return gridPart().contains( *hostIterator_ );
95 const GridPartType &gridPart ()
const {
return gridPart_; }
97 const GridPartType &gridPart_;
98 HostIteratorType hostIterator_;
99 HostIteratorType hostEnd_;
constexpr auto equals
Function object for performing equality comparison.
Definition: hybridutilities.hh:572
Dune namespace.
Definition: alignedallocator.hh:13
constexpr std::bool_constant<((II==value)||...)> contains(std::integer_sequence< T, II... >, std::integral_constant< T, value >)
Checks whether or not a given sequence contains a value.
Definition: integersequence.hh:137