4 #ifndef DUNE_SELECTION_HH
5 #define DUNE_SELECTION_HH
26 template<
typename TS,
typename TG,
typename TL,
int N>
53 SelectionIterator(
const ParallelIndexSetIterator& iter,
const ParallelIndexSetIterator& end)
54 : iter_(iter), end_(end)
57 while(iter_!=end_ && !AttributeSet::contains(iter_->local().attribute()))
64 for(++iter_; iter_!=end_; ++iter_)
65 if(AttributeSet::contains(iter_->local().attribute()))
72 return iter_->local().local();
77 return iter_ == other.iter_;
82 return iter_ != other.iter_;
86 ParallelIndexSetIterator iter_;
87 const ParallelIndexSetIterator end_;
94 template<
typename TS,
typename TG,
typename TL,
int N>
141 : indexSet_(&indexset)
147 void setIndexSet(
const ParallelIndexSet& indexset);
158 const_iterator
begin()
const;
164 const_iterator
end()
const;
168 const ParallelIndexSet* indexSet_;
175 template<
typename TS,
typename TG,
typename TL,
int N>
222 : selected_(), size_(0), built_(false)
233 void setIndexSet(
const ParallelIndexSet& indexset);
249 const_iterator
begin()
const;
255 const_iterator
end()
const;
265 template<
typename TS,
typename TG,
typename TL,
int N>
273 const const_iterator end = indexset.
end();
276 for(const_iterator index = indexset.
begin(); index != end; ++index)
277 if(AttributeSet::contains(index->local().attribute()))
280 selected_ =
new uint32_t[entries];
284 for(const_iterator index = indexset.
begin(); index != end; ++index)
285 if(AttributeSet::contains(index->local().attribute()))
286 selected_[entries++]= index->local().local();
292 template<
typename TS,
typename TG,
typename TL,
int N>
298 template<
typename TS,
typename TG,
typename TL,
int N>
301 return selected_+
size_;
304 template<
typename TS,
typename TG,
typename TL,
int N>
312 template<
typename TS,
typename TG,
typename TL,
int N>
319 template<
typename TS,
typename TG,
typename TL,
int N>
326 template<
typename TS,
typename TG,
typename TL,
int N>
332 template<
typename TS,
typename TG,
typename TL,
int N>
335 indexSet_ = &indexset;
UncachedSelection()
Definition: selection.hh:136
An uncached selection of indices.
Definition: selection.hh:95
Manager class for the mapping between local indices and globally unique indices.
Definition: indexset.hh:217
const_iterator end() const
Get an iterator over the selected indices.
Definition: selection.hh:327
UncachedSelection(const ParallelIndexSet &indexset)
Definition: selection.hh:140
Dune namespace.
Definition: alignment.hh:13
TS AttributeSet
The type of the Set of attributes.
Definition: selection.hh:106
iterator end()
Get an iterator over the indices positioned after the last index.
Provides a map between global and local indices.
void setIndexSet(const ParallelIndexSet &indexset)
Set the index set of the selection.
Definition: selection.hh:333
SelectionIterator(const ParallelIndexSetIterator &iter, const ParallelIndexSetIterator &end)
Constructor.
Definition: selection.hh:53
A cached selection of indices.
Definition: selection.hh:176
std::size_t size_
The size of the buffer.
Definition: variablesizecommunicator.hh:132
A constant random access iterator for the Dune::ArrayList class.
Definition: arraylist.hh:21
bool operator!=(const SelectionIterator< TS, TG, TL, N > &other) const
Definition: selection.hh:80
TG GlobalIndex
The type of the global index of the underlying index set.
Definition: selection.hh:111
uint32_t * iterator
The type of the iterator of the selected indices.
Definition: selection.hh:210
bool operator==(const SelectionIterator< TS, TG, TL, N > &other) const
Definition: selection.hh:75
iterator begin()
Get an iterator over the indices positioned at the first index.
iterator const_iterator
The type of the iterator of the selected indices.
Definition: selection.hh:134
A const iterator over an uncached selection.
Definition: selection.hh:27
TS AttributeSet
The type of the Set of attributes.
Definition: selection.hh:38
TS AttributeSet
The type of the set of attributes.
Definition: selection.hh:187
TL LocalIndex
The type of the local index of the underlying index set.
Definition: selection.hh:200
const_iterator begin() const
Get the index set we are a selection for.
Definition: selection.hh:320
Dune::ParallelIndexSet< TG, TL, N > ParallelIndexSet
The type of the underlying index set.
Definition: selection.hh:43
ConstArrayListIterator< IndexPair< TG, TL >, N, std::allocator< Dune::IndexPair< TG, TL > > > ParallelIndexSetIterator
Definition: selection.hh:47
void operator++()
Definition: selection.hh:61
SelectionIterator< TS, TG, TL, N > iterator
The type of the iterator of the selected indices.
Definition: selection.hh:129
void setIndexSet(const ParallelIndexSet &indexset)
Set the index set of the selection.
Definition: selection.hh:266
Dune::ParallelIndexSet< GlobalIndex, LocalIndex, N > ParallelIndexSet
The type of the underlying index set.
Definition: selection.hh:124
const_iterator end() const
Get an iterator over the selected indices.
Definition: selection.hh:299
uint32_t * const_iterator
The type of the iterator of the selected indices.
Definition: selection.hh:215
Selection()
Definition: selection.hh:217
Dune::ParallelIndexSet< GlobalIndex, LocalIndex, N > ParallelIndexSet
The type of the underlying index set.
Definition: selection.hh:205
Selection(const ParallelIndexSet &indexset)
Definition: selection.hh:221
TL LocalIndex
The type of the local index of the underlying index set.
Definition: selection.hh:119
TG GlobalIndex
The type of the global index of the underlying index set.
Definition: selection.hh:192
This file implements iterator facade classes for writing stl conformant iterators.
const_iterator begin() const
Get the index set we are a selection for.
Definition: selection.hh:293
uint32_t operator*() const
Definition: selection.hh:70
~Selection()
Definition: selection.hh:313
void free()
Free allocated memory.
Definition: selection.hh:305