dune-pdelab  2.7-git
Classes | Public Types | Public Member Functions | Static Public Attributes | List of all members
Dune::PDELab::DOFIndex< T, tree_n, entity_n > Class Template Reference

A multi-index representing a degree of freedom in a GridFunctionSpace. More...

#include <dune/pdelab/common/dofindex.hh>

Classes

class  View
 

Public Types

typedef std::array< T, entity_capacityEntityIndex
 
typedef MultiIndex< T, max_depthTreeIndex
 
typedef TreeIndex::size_type size_type
 
typedef T value_type
 

Public Member Functions

 DOFIndex ()
 Default constructor. More...
 
 DOFIndex (const View &view)
 
View view () const
 
View view (std::size_t size) const
 
void clear ()
 
EntityIndexentityIndex ()
 Returns the index of the grid entity associated with the DOF. More...
 
const EntityIndexentityIndex () const
 Returns the index of the grid entity associated with the DOF. More...
 
TreeIndextreeIndex ()
 Returns the tuple of entity-local indices associated with the DOF. More...
 
const TreeIndextreeIndex () const
 Returns the tuple of entity-local indices associated with the DOF. More...
 
bool operator== (const DOFIndex &r) const
 Tests whether two DOFIndices are equal. More...
 
bool operator!= (const DOFIndex &r) const
 Tests whether two DOFIndices are not equal. More...
 
std::size_t size () const
 

Static Public Attributes

static const std::size_t entity_capacity = entity_n
 The maximum possible length of a tuple which represents the entity index. More...
 
static const std::size_t max_depth = tree_n
 The maximum possible length of the tuple of entity-local indices. More...
 

Detailed Description

template<typename T, std::size_t tree_n, std::size_t entity_n = 1>
class Dune::PDELab::DOFIndex< T, tree_n, entity_n >

A multi-index representing a degree of freedom in a GridFunctionSpace.

A DOFIndex provides a way for identifying degrees of freedom in a (possibly nested) GridFunctionSpace without imposing any kind of ordering. For that purpose, a DOFIndex identifies a degree of freedom by recording

The length of this index tuple is limited by the template parameter tree_n, which will usually be equal to the maximum depth of the current GridFunctionSpace tree. Moreover, there will never be two identical index tuples associated with the same grid entity.

The index tuple is oriented from left to right when traversing up the tree (i.e. towards the root node) and from right to left when drilling down from the root node towards a leaf. For non-leaf nodes, the associated index entry identifies the child GridFunctionSpace that the degree of freedom is associated with, while for leafs, it provides a way to provide multiple degrees of freedom for a single grid entity (usually, the index value for a leaf space will correspond to the LocalKey::index() value from the finite element).

Note that in general, the length of the index tuple will not be the same for all degrees of freedom in a GridFunctionSpace. Consider the following example of a Taylor-Hood element (P2-P1):

dot_inline_dotgraph_1.png

In this case, degrees of freedom for the velocity components will have an index tuple of length 3, while those related to pressure will only have an index tuple of length 2. For the Taylor-Hood space given above, the DOFIndex associated with a triangle with vertex and edge indices in the range {0,1,2} are

GeometryType grid entity index entity-local index tuple
Point 0 0, 0, 0
Point 1 0, 0, 0
Point 2 0, 0, 0
Line 0 0, 0, 0
Line 1 0, 0, 0
Line 2 0, 0, 0
Point 0 0, 1, 0
Point 1 0, 1, 0
Point 2 0, 1, 0
Line 0 0, 1, 0
Line 1 0, 1, 0
Line 2 0, 1, 0
Point 0 0, 1
Point 1 0, 1
Point 2 0, 1
Template Parameters
Tthe type of the index entries.
tree_nthe maximum length of the tuple of entity-local indices.
entity_nthe maximum length of a tuple which represents the entity index.

Member Typedef Documentation

◆ EntityIndex

template<typename T , std::size_t tree_n, std::size_t entity_n = 1>
typedef std::array<T,entity_capacity> Dune::PDELab::DOFIndex< T, tree_n, entity_n >::EntityIndex

◆ size_type

template<typename T , std::size_t tree_n, std::size_t entity_n = 1>
typedef TreeIndex::size_type Dune::PDELab::DOFIndex< T, tree_n, entity_n >::size_type

◆ TreeIndex

template<typename T , std::size_t tree_n, std::size_t entity_n = 1>
typedef MultiIndex<T,max_depth> Dune::PDELab::DOFIndex< T, tree_n, entity_n >::TreeIndex

◆ value_type

template<typename T , std::size_t tree_n, std::size_t entity_n = 1>
typedef T Dune::PDELab::DOFIndex< T, tree_n, entity_n >::value_type

Constructor & Destructor Documentation

◆ DOFIndex() [1/2]

template<typename T , std::size_t tree_n, std::size_t entity_n = 1>
Dune::PDELab::DOFIndex< T, tree_n, entity_n >::DOFIndex ( )
inline

Default constructor.

◆ DOFIndex() [2/2]

template<typename T , std::size_t tree_n, std::size_t entity_n = 1>
Dune::PDELab::DOFIndex< T, tree_n, entity_n >::DOFIndex ( const View view)
inlineexplicit

Member Function Documentation

◆ clear()

template<typename T , std::size_t tree_n, std::size_t entity_n = 1>
void Dune::PDELab::DOFIndex< T, tree_n, entity_n >::clear ( )
inline

◆ entityIndex() [1/2]

template<typename T , std::size_t tree_n, std::size_t entity_n = 1>
EntityIndex& Dune::PDELab::DOFIndex< T, tree_n, entity_n >::entityIndex ( )
inline

Returns the index of the grid entity associated with the DOF.

◆ entityIndex() [2/2]

template<typename T , std::size_t tree_n, std::size_t entity_n = 1>
const EntityIndex& Dune::PDELab::DOFIndex< T, tree_n, entity_n >::entityIndex ( ) const
inline

Returns the index of the grid entity associated with the DOF.

◆ operator!=()

template<typename T , std::size_t tree_n, std::size_t entity_n = 1>
bool Dune::PDELab::DOFIndex< T, tree_n, entity_n >::operator!= ( const DOFIndex< T, tree_n, entity_n > &  r) const
inline

Tests whether two DOFIndices are not equal.

◆ operator==()

template<typename T , std::size_t tree_n, std::size_t entity_n = 1>
bool Dune::PDELab::DOFIndex< T, tree_n, entity_n >::operator== ( const DOFIndex< T, tree_n, entity_n > &  r) const
inline

Tests whether two DOFIndices are equal.

Note
Only DOFIndices of identical max_depth are comparable.

◆ size()

template<typename T , std::size_t tree_n, std::size_t entity_n = 1>
std::size_t Dune::PDELab::DOFIndex< T, tree_n, entity_n >::size ( ) const
inline

◆ treeIndex() [1/2]

template<typename T , std::size_t tree_n, std::size_t entity_n = 1>
TreeIndex& Dune::PDELab::DOFIndex< T, tree_n, entity_n >::treeIndex ( )
inline

Returns the tuple of entity-local indices associated with the DOF.

◆ treeIndex() [2/2]

template<typename T , std::size_t tree_n, std::size_t entity_n = 1>
const TreeIndex& Dune::PDELab::DOFIndex< T, tree_n, entity_n >::treeIndex ( ) const
inline

Returns the tuple of entity-local indices associated with the DOF.

◆ view() [1/2]

template<typename T , std::size_t tree_n, std::size_t entity_n = 1>
View Dune::PDELab::DOFIndex< T, tree_n, entity_n >::view ( ) const
inline

◆ view() [2/2]

template<typename T , std::size_t tree_n, std::size_t entity_n = 1>
View Dune::PDELab::DOFIndex< T, tree_n, entity_n >::view ( std::size_t  size) const
inline

Member Data Documentation

◆ entity_capacity

template<typename T , std::size_t tree_n, std::size_t entity_n = 1>
const std::size_t Dune::PDELab::DOFIndex< T, tree_n, entity_n >::entity_capacity = entity_n
static

The maximum possible length of a tuple which represents the entity index.

◆ max_depth

template<typename T , std::size_t tree_n, std::size_t entity_n = 1>
const std::size_t Dune::PDELab::DOFIndex< T, tree_n, entity_n >::max_depth = tree_n
static

The maximum possible length of the tuple of entity-local indices.


The documentation for this class was generated from the following file: