3 #ifndef DUNE_SELECTION_HH
4 #define DUNE_SELECTION_HH
25 template<
typename TS,
typename TG,
typename TL,
int N>
52 SelectionIterator(
const ParallelIndexSetIterator& iter,
const ParallelIndexSetIterator& end)
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_;
85 ParallelIndexSetIterator iter_;
86 const ParallelIndexSetIterator end_;
93 template<
typename TS,
typename TG,
typename TL,
int N>
140 : indexSet_(&indexset)
146 void setIndexSet(
const ParallelIndexSet& indexset);
157 const_iterator
begin()
const;
163 const_iterator
end()
const;
167 const ParallelIndexSet* indexSet_;
174 template<
typename TS,
typename TG,
typename TL,
int N>
221 : selected_(), size_(0), built_(false)
232 void setIndexSet(
const ParallelIndexSet& indexset);
248 const_iterator
begin()
const;
254 const_iterator
end()
const;
264 template<
typename TS,
typename TG,
typename TL,
int N>
272 const const_iterator end = indexset.
end();
275 for(const_iterator index = indexset.
begin(); index != end; ++index)
276 if(AttributeSet::contains(index->local().attribute()))
279 selected_ =
new uint32_t[entries];
283 for(const_iterator index = indexset.
begin(); index != end; ++index)
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;
Dune::ParallelIndexSet< GlobalIndex, LocalIndex, N > ParallelIndexSet
The type of the underlying index set.
Definition: selection.hh:204
const_iterator end() const
Get an iterator over the selected indices.
Definition: selection.hh:326
uint32_t operator*() const
Definition: selection.hh:69
Selection(const ParallelIndexSet &indexset)
Definition: selection.hh:220
bool operator!=(const SelectionIterator< TS, TG, TL, N > &other) const
Definition: selection.hh:79
void setIndexSet(const ParallelIndexSet &indexset)
Set the index set of the selection.
Definition: selection.hh:265
Selection()
Definition: selection.hh:216
TL LocalIndex
The type of the local index of the underlying index set.
Definition: selection.hh:199
This file implements iterator facade classes for writing stl conformant iterators.
ConstArrayListIterator< IndexPair< TG, TL >, N, std::allocator< Dune::IndexPair< TG, TL > > > ParallelIndexSetIterator
Definition: selection.hh:46
const_iterator begin() const
Get the index set we are a selection for.
Definition: selection.hh:319
TG GlobalIndex
The type of the global index of the underlying index set.
Definition: selection.hh:191
iterator begin()
Get an iterator over the indices positioned at the first index.
const_iterator end() const
Get an iterator over the selected indices.
Definition: selection.hh:298
Provides a map between global and local indices.
UncachedSelection()
Definition: selection.hh:135
uint32_t * iterator
The type of the iterator of the selected indices.
Definition: selection.hh:209
std::size_t size_
The size of the buffer.
Definition: variablesizecommunicator.hh:132
Dune namespace.
Definition: alignment.hh:9
SelectionIterator(const ParallelIndexSetIterator &iter, const ParallelIndexSetIterator &end)
Constructor.
Definition: selection.hh:52
A const iterator over an uncached selection.
Definition: selection.hh:26
iterator end()
Get an iterator over the indices positioned after the last index.
~Selection()
Definition: selection.hh:312
void setIndexSet(const ParallelIndexSet &indexset)
Set the index set of the selection.
Definition: selection.hh:332
A constant random access iterator for the Dune::ArrayList class.
Definition: arraylist.hh:20
Dune::ParallelIndexSet< GlobalIndex, LocalIndex, N > ParallelIndexSet
The type of the underlying index set.
Definition: selection.hh:123
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:37
TL LocalIndex
The type of the local index of the underlying index set.
Definition: selection.hh:118
UncachedSelection(const ParallelIndexSet &indexset)
Definition: selection.hh:139
A cached selection of indices.
Definition: selection.hh:175
const_iterator begin() const
Get the index set we are a selection for.
Definition: selection.hh:292
Dune::ParallelIndexSet< TG, TL, N > ParallelIndexSet
The type of the underlying index set.
Definition: selection.hh:42
TS AttributeSet
The type of the set of attributes.
Definition: selection.hh:186
void free()
Free allocated memory.
Definition: selection.hh:304
TG GlobalIndex
The type of the global index of the underlying index set.
Definition: selection.hh:110
bool operator==(const SelectionIterator< TS, TG, TL, N > &other) const
Definition: selection.hh:74
An uncached selection of indices.
Definition: selection.hh:94
TS AttributeSet
The type of the Set of attributes.
Definition: selection.hh:105
void operator++()
Definition: selection.hh:60
iterator const_iterator
The type of the iterator of the selected indices.
Definition: selection.hh:133
uint32_t * const_iterator
The type of the iterator of the selected indices.
Definition: selection.hh:214
Manager class for the mapping between local indices and globally unique indices.
Definition: indexset.hh:216