3 #ifndef DUNE_PDELAB_COMMON_DOFINDEX_HH
4 #define DUNE_PDELAB_COMMON_DOFINDEX_HH
7 #include <dune/common/array.hh>
13 template<
typename T, std::
size_t tree_n, std::
size_t entity_n = 1>
44 return _entity_index_view;
49 return _tree_index_view;
54 return View(_entity_index_view,_tree_index_view.back_popped());
61 for (
typename std::remove_reference<EntityIndex>::type::const_iterator it = di._entity_index_view.begin(); it != di._entity_index_view.end(); ++it)
62 s << std::setw(4) << *it;
65 << di._tree_index_view
72 return _tree_index_view.size();
79 , _tree_index_view(dof_index._tree_index.
view())
84 , _tree_index_view(dof_index._tree_index.
view(size))
88 : _entity_index_view(entity_index)
89 , _tree_index_view(tree_index)
103 , _tree_index(view._tree_index_view)
113 return View(*
this,size);
148 for (
typename EntityIndex::const_iterator it = di._entity_index.begin(); it != di._entity_index.end(); ++it)
149 s << std::setw(4) << *it;
165 _tree_index == r._tree_index;
171 return !(*
this == r);
175 bool operator< (
const DOFIndex& r)
const
178 return _c.size() < _r.size();
179 return std::lexicographical_compare(_c.begin(),_c.end(),r._c.begin(),r._c.end());
185 return _tree_index.size();
195 template<
typename T, std::
size_t n1, std::
size_t n2>
198 std::size_t seed = 0;
211 #endif // DUNE_PDELAB_COMMON_DOFINDEX_HH
T value_type
Definition: dofindex.hh:27
Definition: dofindex.hh:14
TreeIndex & treeIndex()
Definition: dofindex.hh:133
const array< T, entity_n > & EntityIndex
Definition: dofindex.hh:39
std::size_t size() const
Definition: dofindex.hh:183
bool operator==(const DOFIndex &r) const
Tests whether two MultiIndices are equal.
Definition: dofindex.hh:161
static const std::size_t max_depth
The maximum possible depth of the MultiIndex.
Definition: dofindex.hh:20
View back_popped() const
Definition: dofindex.hh:52
friend std::ostream & operator<<(std::ostream &s, const DOFIndex &di)
Writes a pretty representation of the MultiIndex to the given std::ostream.
Definition: dofindex.hh:144
const EntityIndex & _entity_index
Definition: datahandleprovider.hh:47
static const std::size_t entity_capacity
Definition: dofindex.hh:21
const EntityIndex & entityIndex() const
Definition: dofindex.hh:42
Definition: dofindex.hh:29
friend std::ostream & operator<<(std::ostream &s, const View &di)
Definition: dofindex.hh:57
static const std::size_t max_depth
Definition: dofindex.hh:36
array< T, entity_capacity > EntityIndex
Definition: dofindex.hh:23
const TreeIndex & treeIndex() const
Definition: dofindex.hh:47
DOFIndex()
Default constructor.
Definition: dofindex.hh:98
const TreeIndex & treeIndex() const
Definition: dofindex.hh:138
bool operator!=(const DOFIndex &r) const
Tests whether two MultiIndices are not equal.
Definition: dofindex.hh:169
const EntityIndex & entityIndex() const
Definition: dofindex.hh:128
EntityIndex & entityIndex()
Returns the index of the grid entity associated with the DOF.
Definition: dofindex.hh:123
TreeIndex::size_type size_type
Definition: dofindex.hh:26
static const std::size_t entity_capacity
Definition: dofindex.hh:37
void clear()
Definition: dofindex.hh:116
DOFIndex(const View &view)
Definition: dofindex.hh:101
View view(std::size_t size) const
Definition: dofindex.hh:111
std::size_t hash_value(const DOFIndex< T, n1, n2 > &di)
Definition: dofindex.hh:196
std::size_t size() const
Definition: dofindex.hh:70
MultiIndex< T, max_depth > TreeIndex
Definition: dofindex.hh:24
const std::string s
Definition: function.hh:1103
MultiIndex< T, tree_n >::View TreeIndex
Definition: dofindex.hh:40
View view() const
Definition: dofindex.hh:106