3 #ifndef DUNE_PDELAB_COMMON_DOFINDEX_HH 4 #define DUNE_PDELAB_COMMON_DOFINDEX_HH 7 #include <dune/common/array.hh> 145 template<
typename T, std::
size_t tree_n, std::
size_t entity_n = 1>
170 static const std::size_t max_depth = tree_n;
171 static const std::size_t entity_capacity = entity_n;
178 return _entity_index_view;
183 return _tree_index_view;
188 return View(_entity_index_view,_tree_index_view.back_popped());
195 for (
typename std::remove_reference<EntityIndex>::type::const_iterator it = di._entity_index_view.begin(); it != di._entity_index_view.end(); ++it)
196 s << std::setw(4) << *it;
199 << di._tree_index_view
206 return _tree_index_view.size();
212 : _entity_index_view(dof_index._entity_index)
213 , _tree_index_view(dof_index._tree_index.
view())
217 : _entity_index_view(dof_index._entity_index)
218 , _tree_index_view(dof_index._tree_index.
view(size))
221 View(EntityIndex& entity_index,
const TreeIndex& tree_index)
222 : _entity_index_view(entity_index)
223 , _tree_index_view(tree_index)
226 EntityIndex _entity_index_view;
227 TreeIndex _tree_index_view;
236 : _entity_index(view._entity_index_view)
237 , _tree_index(view._tree_index_view)
247 return View(*
this,size);
252 std::fill(_entity_index.begin(),_entity_index.end(),0);
259 return _entity_index;
265 return _entity_index;
285 for (
typename EntityIndex::const_iterator it = di._entity_index.begin(); it != di._entity_index.end(); ++it)
286 s << std::setw(4) << *it;
301 std::equal(_entity_index.begin(),_entity_index.end(),r._entity_index.begin()) &&
302 _tree_index == r._tree_index;
308 return !(*
this == r);
312 bool operator< (
const DOFIndex& r)
const 315 return _c.size() < _r.size();
316 return std::lexicographical_compare(_c.begin(),_c.end(),r._c.begin(),r._c.end());
322 return _tree_index.size();
327 EntityIndex _entity_index;
328 TreeIndex _tree_index;
332 template<
typename T, std::
size_t n1, std::
size_t n2>
335 std::size_t seed = 0;
348 #endif // DUNE_PDELAB_COMMON_DOFINDEX_HH bool operator==(const DOFIndex &r) const
Tests whether two DOFIndices are equal.
Definition: dofindex.hh:298
View back_popped() const
Definition: dofindex.hh:186
static const std::size_t max_depth
The maximum possible length of the tuple of entity-local indices.
Definition: dofindex.hh:155
DOFIndex(const View &view)
Definition: dofindex.hh:235
const EntityIndex & entityIndex() const
Returns the index of the grid entity associated with the DOF.
Definition: dofindex.hh:263
std::size_t size() const
Definition: dofindex.hh:204
const TreeIndex & treeIndex() const
Definition: dofindex.hh:181
static const std::size_t entity_capacity
The maximum possible length of a tuple which represents the entity index.
Definition: dofindex.hh:152
void clear()
Definition: dofindex.hh:250
TreeIndex::size_type size_type
Definition: dofindex.hh:160
const std::string s
Definition: function.hh:1101
const std::array< T, entity_n > & EntityIndex
Definition: dofindex.hh:173
EntityIndex & entityIndex()
Returns the index of the grid entity associated with the DOF.
Definition: dofindex.hh:257
For backward compatibility – Do not use this!
Definition: adaptivity.hh:27
DOFIndex()
Default constructor.
Definition: dofindex.hh:232
bool operator!=(const DOFIndex &r) const
Tests whether two DOFIndices are not equal.
Definition: dofindex.hh:306
friend std::ostream & operator<<(std::ostream &s, const View &di)
Definition: dofindex.hh:191
View view(std::size_t size) const
Definition: dofindex.hh:245
std::size_t hash_value(const DOFIndex< T, n1, n2 > &di)
Definition: dofindex.hh:333
TreeIndex & treeIndex()
Returns the tuple of entity-local indices associated with the DOF.
Definition: dofindex.hh:269
std::array< T, entity_capacity > EntityIndex
Definition: dofindex.hh:157
EntityIndex & entityIndex() const
Definition: dofindex.hh:176
MultiIndex< T, max_depth > TreeIndex
Definition: dofindex.hh:158
std::size_t size() const
Definition: dofindex.hh:320
Definition: dofindex.hh:163
const TreeIndex & treeIndex() const
Returns the tuple of entity-local indices associated with the DOF.
Definition: dofindex.hh:275
T value_type
Definition: dofindex.hh:161
View view() const
Definition: multiindex.hh:171
A multi-index representing a degree of freedom in a GridFunctionSpace.
Definition: dofindex.hh:146
MultiIndex< T, tree_n >::View TreeIndex
Definition: dofindex.hh:174
View view() const
Definition: dofindex.hh:240