PTEMS  0.1.0-dev+git.81fd0e4
PolyTopic Element Method Solver
ptems::DoFData< N, T > Struct Template Reference

Immutable structure for storing DoF or basis data for a DiscreteFunctionSpace. More...

#include <ptems/space.hpp>

Classes

class  ComponentData
 Type for a proxy object to access one component of the vector space DoF data only. More...
 

Public Types

typedef std::vector< T >::value_type value_type
 The type of the data being stored. More...
 
typedef std::vector< T >::reference reference
 Reference to the type of the data being stored. More...
 
typedef std::vector< T >::const_reference const_reference
 Const reference to the type of the data being stored. More...
 
typedef std::vector< T >::size_type size_type
 Type for the size function and indexing operators. More...
 
typedef std::vector< T >::const_iterator iterator
 Type for iterator over the data in linear indexing order. More...
 
typedef std::vector< T >::const_iterator const_iterator
 Type for const iterator over the data in linear indexing order. More...
 

Public Member Functions

 DoFData (const std::array< size_type, N > &sizes, const T &value=T())
 Create the structure of the specified size filled with specified value. More...
 
 DoFData (std::array< size_type, N > &&sizes, const T &value=T())
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
ComponentData operator() (size_type n) const
 Gets all the entries for the specified component of the vector space. More...
 
template<size_type n, typename = std::enable_if_t<(n < N)>>
ComponentData Var () const
 Gets all the entries for the specified component of the vector space. More...
 
const_reference operator() (size_type component, size_type dof) const
 Gets the entry for the specified component and DoF number. More...
 
const_reference operator[] (size_type i) const
 Gets the entry by linear indexing across all components. More...
 
size_type size () const
 Gets the total number of entries across all components. More...
 
size_type size (size_type n) const
 Gets the number of entries for the specified component. More...
 
template<size_type n, typename = std::enable_if_t<(n < N)>>
size_type size () const
 Gets the number of entries for the specified component. More...
 
const_iterator begin () const
 Gets the begin iterator over the entries in linear indexing order. More...
 
const_iterator cbegin () const
 Gets the begin iterator over the entries in linear indexing order. More...
 
const_iterator end () const
 Gets the end iterator over the entries in linear indexing order. More...
 
const_iterator cend () const
 Gets the end iterator over the entries in linear indexing order. More...
 

Friends

template<std::size_t DIM, typename X , std::size_t N1>
class DiscreteFunctionSpace
 

Detailed Description

template<std::size_t N, typename T>
struct ptems::DoFData< N, T >

Immutable structure for storing DoF or basis data for a DiscreteFunctionSpace.

This object stores the DoF/Basis "per component" and can be indexed by component for a vector space & dof number with operator() or it can be accessed in a continuous linear manner using with operator[], or the begin()/end() iterator pair, where the DoFs/basis are ordered by all DoFs of the first component, then all of the second, etc

Template Parameters
NThe number of components in the
TThe type of the DoF/Basis data being stored

Member Typedef Documentation

◆ const_iterator

template<std::size_t N, typename T >
typedef std::vector<T>::const_iterator ptems::DoFData< N, T >::const_iterator

Type for const iterator over the data in linear indexing order.

◆ const_reference

template<std::size_t N, typename T >
typedef std::vector<T>::const_reference ptems::DoFData< N, T >::const_reference

Const reference to the type of the data being stored.

◆ iterator

template<std::size_t N, typename T >
typedef std::vector<T>::const_iterator ptems::DoFData< N, T >::iterator

Type for iterator over the data in linear indexing order.

◆ reference

template<std::size_t N, typename T >
typedef std::vector<T>::reference ptems::DoFData< N, T >::reference

Reference to the type of the data being stored.

◆ size_type

template<std::size_t N, typename T >
typedef std::vector<T>::size_type ptems::DoFData< N, T >::size_type

Type for the size function and indexing operators.

◆ value_type

template<std::size_t N, typename T >
typedef std::vector<T>::value_type ptems::DoFData< N, T >::value_type

The type of the data being stored.

Constructor & Destructor Documentation

◆ DoFData() [1/2]

template<std::size_t N, typename T >
ptems::DoFData< N, T >::DoFData ( const std::array< size_type, N > &  sizes,
const T &  value = T() 
)
inlineexplicit

Create the structure of the specified size filled with specified value.

Parameters
sizesThe size of each component
valueInitial value for each entry

◆ DoFData() [2/2]

template<std::size_t N, typename T >
ptems::DoFData< N, T >::DoFData ( std::array< size_type, N > &&  sizes,
const T &  value = T() 
)
inlineexplicit

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Member Function Documentation

◆ begin()

template<std::size_t N, typename T >
const_iterator ptems::DoFData< N, T >::begin ( ) const
inline

Gets the begin iterator over the entries in linear indexing order.

◆ cbegin()

template<std::size_t N, typename T >
const_iterator ptems::DoFData< N, T >::cbegin ( ) const
inline

Gets the begin iterator over the entries in linear indexing order.

◆ cend()

template<std::size_t N, typename T >
const_iterator ptems::DoFData< N, T >::cend ( ) const
inline

Gets the end iterator over the entries in linear indexing order.

◆ end()

template<std::size_t N, typename T >
const_iterator ptems::DoFData< N, T >::end ( ) const
inline

Gets the end iterator over the entries in linear indexing order.

◆ operator()() [1/2]

template<std::size_t N, typename T >
const_reference ptems::DoFData< N, T >::operator() ( size_type  component,
size_type  dof 
) const
inline

Gets the entry for the specified component and DoF number.

Exceptions
std::out_of_rangeIf component is not in the range [0,N).
std::out_of_rangeIf dof is not in the range [0,size(component)).
Parameters
componentThe component index
dofThe DoF index
Returns
Reference to the specified entry

◆ operator()() [2/2]

template<std::size_t N, typename T >
ComponentData ptems::DoFData< N, T >::operator() ( size_type  n) const
inline

Gets all the entries for the specified component of the vector space.

Exceptions
std::out_of_rangeIf n is not in the range [0,N).
Parameters
nThe component index
Returns
Proxy object to the entries of the specified component

◆ operator[]()

template<std::size_t N, typename T >
const_reference ptems::DoFData< N, T >::operator[] ( size_type  i) const
inline

Gets the entry by linear indexing across all components.

Exceptions
std::out_of_rangeIf i is not in the range [0,size()).
Parameters
iLinear index of entry to get
Returns
Reference to the specified entry

◆ size() [1/3]

template<std::size_t N, typename T >
size_type ptems::DoFData< N, T >::size ( ) const
inline

Gets the total number of entries across all components.

◆ size() [2/3]

template<std::size_t N, typename T >
template<size_type n, typename = std::enable_if_t<(n < N)>>
size_type ptems::DoFData< N, T >::size ( ) const
inline

Gets the number of entries for the specified component.

Template Parameters
nThe component index

◆ size() [3/3]

template<std::size_t N, typename T >
size_type ptems::DoFData< N, T >::size ( size_type  n) const
inline

Gets the number of entries for the specified component.

Parameters
nThe component index

◆ Var()

template<std::size_t N, typename T >
template<size_type n, typename = std::enable_if_t<(n < N)>>
ComponentData ptems::DoFData< N, T >::Var ( ) const
inline

Gets all the entries for the specified component of the vector space.

Template Parameters
nThe component index
Returns
Proxy object to the entries of the specified component

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