5#ifndef DUNE_COMMON_PARALLEL_SELECTION_HH
6#define DUNE_COMMON_PARALLEL_SELECTION_HH
29 template<
typename TS,
typename TG,
typename TL,
int N>
57 : iter_(iter), end_(end)
60 while(iter_!=end_ && !AttributeSet::contains(iter_->local().attribute()))
67 for(++iter_; iter_!=end_; ++iter_)
68 if(AttributeSet::contains(iter_->local().attribute()))
75 return iter_->local().local();
80 return iter_ == other.iter_;
85 return iter_ != other.iter_;
97 template<
typename TS,
typename TG,
typename TL,
int N>
144 : indexSet_(&indexset)
178 template<
typename TS,
typename TG,
typename TL,
int N>
225 : selected_(), size_(0), built_(false)
268 template<
typename TS,
typename TG,
typename TL,
int N>
280 if(AttributeSet::contains(index->local().attribute()))
283 selected_ =
new uint32_t[entries];
288 if(AttributeSet::contains(index->local().attribute()))
289 selected_[entries++]= index->local().local();
295 template<
typename TS,
typename TG,
typename TL,
int N>
301 template<
typename TS,
typename TG,
typename TL,
int N>
304 return selected_+size_;
307 template<
typename TS,
typename TG,
typename TL,
int N>
315 template<
typename TS,
typename TG,
typename TL,
int N>
322 template<
typename TS,
typename TG,
typename TL,
int N>
329 template<
typename TS,
typename TG,
typename TL,
int N>
335 template<
typename TS,
typename TG,
typename TL,
int N>
338 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:330
void setIndexSet(const ParallelIndexSet &indexset)
Set the index set of the selection.
Definition selection.hh:269
void setIndexSet(const ParallelIndexSet &indexset)
Set the index set of the selection.
Definition selection.hh:336
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:302
const_iterator begin() const
Get the index set we are a selection for.
Definition selection.hh:296
void free()
Free allocated memory.
Definition selection.hh:308
const_iterator begin() const
Get the index set we are a selection for.
Definition selection.hh:323
~Selection()
Definition selection.hh:316
Dune namespace.
Definition alignedallocator.hh:13
A constant random access iterator for the Dune::ArrayList class.
Definition arraylist.hh:368
Manager class for the mapping between local indices and globally unique indices.
Definition indexset.hh:218
A const iterator over an uncached selection.
Definition selection.hh:31
ConstArrayListIterator< IndexPair< TG, TL >, N, std::allocator< Dune::IndexPair< TG, TL > > > ParallelIndexSetIterator
Definition selection.hh:50
void operator++()
Definition selection.hh:64
uint32_t operator*() const
Definition selection.hh:73
TS AttributeSet
The type of the Set of attributes.
Definition selection.hh:41
Dune::ParallelIndexSet< TG, TL, N > ParallelIndexSet
The type of the underlying index set.
Definition selection.hh:46
SelectionIterator(const ParallelIndexSetIterator &iter, const ParallelIndexSetIterator &end)
Constructor.
Definition selection.hh:56
bool operator!=(const SelectionIterator< TS, TG, TL, N > &other) const
Definition selection.hh:83
bool operator==(const SelectionIterator< TS, TG, TL, N > &other) const
Definition selection.hh:78
An uncached selection of indices.
Definition selection.hh:99
UncachedSelection()
Definition selection.hh:139
SelectionIterator< TS, TG, TL, N > iterator
The type of the iterator of the selected indices.
Definition selection.hh:132
TS AttributeSet
The type of the Set of attributes.
Definition selection.hh:109
iterator const_iterator
The type of the iterator of the selected indices.
Definition selection.hh:137
TG GlobalIndex
The type of the global index of the underlying index set.
Definition selection.hh:114
UncachedSelection(const ParallelIndexSet &indexset)
Definition selection.hh:143
Dune::ParallelIndexSet< GlobalIndex, LocalIndex, N > ParallelIndexSet
The type of the underlying index set.
Definition selection.hh:127
TL LocalIndex
The type of the local index of the underlying index set.
Definition selection.hh:122
A cached selection of indices.
Definition selection.hh:180
TG GlobalIndex
The type of the global index of the underlying index set.
Definition selection.hh:195
Selection(const ParallelIndexSet &indexset)
Definition selection.hh:224
Selection()
Definition selection.hh:220
TL LocalIndex
The type of the local index of the underlying index set.
Definition selection.hh:203
TS AttributeSet
The type of the set of attributes.
Definition selection.hh:190
uint32_t * iterator
The type of the iterator of the selected indices.
Definition selection.hh:213
uint32_t * const_iterator
The type of the iterator of the selected indices.
Definition selection.hh:218
Dune::ParallelIndexSet< GlobalIndex, LocalIndex, N > ParallelIndexSet
The type of the underlying index set.
Definition selection.hh:208