3 #ifndef DUNE_SELECTION_HH
4 #define DUNE_SELECTION_HH
25 template<
typename TS,
typename TG,
typename TL,
int N>
53 : iter_(iter), end_(end)
56 while(iter_!=end_ && !AttributeSet::contains(iter_->local().attribute()))
63 for(++iter_; iter_!=end_; ++iter_)
64 if(AttributeSet::contains(iter_->local().attribute()))
71 return iter_->local().local();
76 return iter_ == other.iter_;
81 return iter_ != other.iter_;
93 template<
typename TS,
typename TG,
typename TL,
int N>
140 : indexSet_(&indexset)
174 template<
typename TS,
typename TG,
typename TL,
int N>
221 : selected_(), size_(0), built_(false)
264 template<
typename TS,
typename TG,
typename TL,
int N>
276 if(AttributeSet::contains(index->local().attribute()))
279 selected_ =
new uint32_t[entries];
284 if(AttributeSet::contains(index->local().attribute()))
285 selected_[entries++]= index->local().local();
291 template<
typename TS,
typename TG,
typename TL,
int N>
297 template<
typename TS,
typename TG,
typename TL,
int N>
300 return selected_+size_;
303 template<
typename TS,
typename TG,
typename TL,
int N>
311 template<
typename TS,
typename TG,
typename TL,
int N>
318 template<
typename TS,
typename TG,
typename TL,
int N>
325 template<
typename TS,
typename TG,
typename TL,
int N>
331 template<
typename TS,
typename TG,
typename TL,
int N>
334 indexSet_ = &indexset;
This file implements iterator facade classes for writing stl conformant iterators.
Provides a map between global and local indices.
const_iterator end() const
Get an iterator over the selected indices.
Definition: selection.hh:326
void setIndexSet(const ParallelIndexSet &indexset)
Set the index set of the selection.
Definition: selection.hh:265
void setIndexSet(const ParallelIndexSet &indexset)
Set the index set of the selection.
Definition: selection.hh:332
iterator begin()
Get an iterator over the indices positioned at the first index.
iterator end()
Get an iterator over the indices positioned after the last index.
const_iterator end() const
Get an iterator over the selected indices.
Definition: selection.hh:298
const_iterator begin() const
Get the index set we are a selection for.
Definition: selection.hh:292
void free()
Free allocated memory.
Definition: selection.hh:304
const_iterator begin() const
Get the index set we are a selection for.
Definition: selection.hh:319
~Selection()
Definition: selection.hh:312
Dune namespace.
Definition: alignedallocator.hh:14
A constant random access iterator for the Dune::ArrayList class.
Definition: arraylist.hh:377
A const iterator over an uncached selection.
Definition: selection.hh:27
ConstArrayListIterator< IndexPair< TG, TL >, N, std::allocator< Dune::IndexPair< TG, TL > > > ParallelIndexSetIterator
Definition: selection.hh:46
void operator++()
Definition: selection.hh:60
uint32_t operator*() const
Definition: selection.hh:69
TS AttributeSet
The type of the Set of attributes.
Definition: selection.hh:37
Dune::ParallelIndexSet< TG, TL, N > ParallelIndexSet
The type of the underlying index set.
Definition: selection.hh:42
SelectionIterator(const ParallelIndexSetIterator &iter, const ParallelIndexSetIterator &end)
Constructor.
Definition: selection.hh:52
bool operator!=(const SelectionIterator< TS, TG, TL, N > &other) const
Definition: selection.hh:79
bool operator==(const SelectionIterator< TS, TG, TL, N > &other) const
Definition: selection.hh:74
An uncached selection of indices.
Definition: selection.hh:95
UncachedSelection()
Definition: selection.hh:135
SelectionIterator< TS, TG, TL, N > iterator
The type of the iterator of the selected indices.
Definition: selection.hh:128
TS AttributeSet
The type of the Set of attributes.
Definition: selection.hh:105
iterator const_iterator
The type of the iterator of the selected indices.
Definition: selection.hh:133
TG GlobalIndex
The type of the global index of the underlying index set.
Definition: selection.hh:110
UncachedSelection(const ParallelIndexSet &indexset)
Definition: selection.hh:139
Dune::ParallelIndexSet< GlobalIndex, LocalIndex, N > ParallelIndexSet
The type of the underlying index set.
Definition: selection.hh:123
TL LocalIndex
The type of the local index of the underlying index set.
Definition: selection.hh:118
A cached selection of indices.
Definition: selection.hh:176
TG GlobalIndex
The type of the global index of the underlying index set.
Definition: selection.hh:191
Selection(const ParallelIndexSet &indexset)
Definition: selection.hh:220
Selection()
Definition: selection.hh:216
TL LocalIndex
The type of the local index of the underlying index set.
Definition: selection.hh:199
TS AttributeSet
The type of the set of attributes.
Definition: selection.hh:186
uint32_t * iterator
The type of the iterator of the selected indices.
Definition: selection.hh:209
uint32_t * const_iterator
The type of the iterator of the selected indices.
Definition: selection.hh:214
Dune::ParallelIndexSet< GlobalIndex, LocalIndex, N > ParallelIndexSet
The type of the underlying index set.
Definition: selection.hh:204