5#ifndef DUNE_SELECTION_HH
6#define DUNE_SELECTION_HH
27 template<
typename TS,
typename TG,
typename TL,
int N>
55 : iter_(
iter), end_(end)
58 while(iter_!=end_ && !AttributeSet::contains(iter_->local().attribute()))
65 for(++iter_; iter_!=end_; ++iter_)
66 if(AttributeSet::contains(iter_->local().attribute()))
73 return iter_->local().local();
78 return iter_ == other.iter_;
83 return iter_ != other.iter_;
95 template<
typename TS,
typename TG,
typename TL,
int N>
176 template<
typename TS,
typename TG,
typename TL,
int N>
223 : selected_(), size_(0), built_(
false)
266 template<
typename TS,
typename TG,
typename TL,
int N>
278 if(AttributeSet::contains(index->local().attribute()))
286 if(AttributeSet::contains(index->local().attribute()))
287 selected_[
entries++]= index->local().local();
293 template<
typename TS,
typename TG,
typename TL,
int N>
299 template<
typename TS,
typename TG,
typename TL,
int N>
302 return selected_+size_;
305 template<
typename TS,
typename TG,
typename TL,
int N>
313 template<
typename TS,
typename TG,
typename TL,
int N>
320 template<
typename TS,
typename TG,
typename TL,
int N>
327 template<
typename TS,
typename TG,
typename TL,
int N>
333 template<
typename TS,
typename TG,
typename TL,
int N>
This file implements iterator facade classes for writing stl conformant iterators.
Provides a map between global and local indices.
iterator begin()
Get an iterator that is positioned at the first element.
Definition arraylist.hh:517
ArrayList()
Constructs an Array list with one chunk.
Definition arraylist.hh:457
iterator end()
Get a random access iterator positioned after the last element.
Definition arraylist.hh:529
const_iterator end() const
Get an iterator over the selected indices.
Definition selection.hh:328
void setIndexSet(const ParallelIndexSet &indexset)
Set the index set of the selection.
Definition selection.hh:267
void setIndexSet(const ParallelIndexSet &indexset)
Set the index set of the selection.
Definition selection.hh:334
const_iterator end() const
Get an iterator over the selected indices.
Definition selection.hh:300
const_iterator begin() const
Get the index set we are a selection for.
Definition selection.hh:294
void free()
Free allocated memory.
Definition selection.hh:306
const_iterator begin() const
Get the index set we are a selection for.
Definition selection.hh:321
~Selection()
Definition selection.hh:314
Dune namespace.
Definition alignedallocator.hh:13
A dynamically growing random access list.
Definition arraylist.hh:62
ConstArrayListIterator< MemberType, N, A > const_iterator
A constant random access iterator.
Definition arraylist.hh:110
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:29
ConstArrayListIterator< IndexPair< TG, TL >, N, std::allocator< Dune::IndexPair< TG, TL > > > ParallelIndexSetIterator
Definition selection.hh:48
void operator++()
Definition selection.hh:62
uint32_t operator*() const
Definition selection.hh:71
TS AttributeSet
The type of the Set of attributes.
Definition selection.hh:39
Dune::ParallelIndexSet< TG, TL, N > ParallelIndexSet
The type of the underlying index set.
Definition selection.hh:44
SelectionIterator(const ParallelIndexSetIterator &iter, const ParallelIndexSetIterator &end)
Constructor.
Definition selection.hh:54
bool operator!=(const SelectionIterator< TS, TG, TL, N > &other) const
Definition selection.hh:81
bool operator==(const SelectionIterator< TS, TG, TL, N > &other) const
Definition selection.hh:76
An uncached selection of indices.
Definition selection.hh:97
UncachedSelection()
Definition selection.hh:137
SelectionIterator< TS, TG, TL, N > iterator
The type of the iterator of the selected indices.
Definition selection.hh:130
TS AttributeSet
The type of the Set of attributes.
Definition selection.hh:107
iterator const_iterator
The type of the iterator of the selected indices.
Definition selection.hh:135
TG GlobalIndex
The type of the global index of the underlying index set.
Definition selection.hh:112
UncachedSelection(const ParallelIndexSet &indexset)
Definition selection.hh:141
Dune::ParallelIndexSet< GlobalIndex, LocalIndex, N > ParallelIndexSet
The type of the underlying index set.
Definition selection.hh:125
TL LocalIndex
The type of the local index of the underlying index set.
Definition selection.hh:120
A cached selection of indices.
Definition selection.hh:178
TG GlobalIndex
The type of the global index of the underlying index set.
Definition selection.hh:193
Selection(const ParallelIndexSet &indexset)
Definition selection.hh:222
Selection()
Definition selection.hh:218
TL LocalIndex
The type of the local index of the underlying index set.
Definition selection.hh:201
TS AttributeSet
The type of the set of attributes.
Definition selection.hh:188
uint32_t * iterator
The type of the iterator of the selected indices.
Definition selection.hh:211
uint32_t * const_iterator
The type of the iterator of the selected indices.
Definition selection.hh:216
Dune::ParallelIndexSet< GlobalIndex, LocalIndex, N > ParallelIndexSet
The type of the underlying index set.
Definition selection.hh:206