PTEMS  0.1.0-dev+git.81fd0e4
PolyTopic Element Method Solver
ptems::DiscreteFunction< DIM, X, N, LEN > Class Template Reference

A function over a discrete function space. More...

#include <ptems/discretefunction.hpp>

Inheritance diagram for ptems::DiscreteFunction< DIM, X, N, LEN >:
Collaboration diagram for ptems::DiscreteFunction< DIM, X, N, LEN >:

Public Types

typedef X value_type
 The value of the components of the return type of the function. More...
 
typedef std::vector< X >::size_type size_type
 The type to use for the number of degrees of freedom in the function. More...
 
typedef std::vector< X >::iterator< X > iterator
 Type for an iterator over the degrees of freedom of the function. More...
 
typedef std::vector< X >::const_iterator< X > const_iterator
 Type for a const iterator over the degrees of freedom of the function. More...
 
typedef std::reverse_iterator< iterator >< X > reverse_iterator
 Type for an iterator over the degrees of freedom of the function in reverse. More...
 
typedef std::reverse_iterator< const_iterator >< X > const_reverse_iterator
 Type for a const iterator over the degrees of freedom of the function in reverse. More...
 

Public Member Functions

template<std::size_t S, typename = std::enable_if_t<(S == N) && (S == LEN)>>
 DiscreteFunction (const PDiscreteFunctionSpace< DIM, X, S > &space)
 Creates a function in the specified function space. More...
 
template<std::size_t S, typename = std::enable_if_t<(S == N) && (S == LEN)>>
 DiscreteFunction (const PDiscreteFunctionSpace< DIM, X, S > &space, X value)
 Creates a function in the specified function space, with initial constant function value. More...
 
template<std::size_t S, typename... T, typename = std::enable_if_t<(sizeof...(T) == N) && (S == N) && (S == LEN)>>
 DiscreteFunction (const PDiscreteFunctionSpace< DIM, X, S > &space, T... values)
 Creates a function in the specified function space, with initial constant function value. More...
 
template<std::size_t S, typename = std::enable_if_t<(S == N) && (S == LEN)>>
DiscreteFunctionoperator= (const PDiscreteFunctionSpace< DIM, X, S > &space)
 Reset this function to be a function over the specified space. More...
 
size_type size () const
 Gets the number of degrees of freedom in the function. More...
 
X & operator[] (std::size_t idx)
 Gets a mutable reference to the degree of freedom at the specified index. More...
 
const X & operator[] (std::size_t idx) const
 Gets a const reference to the degree of freedom at the specified index. More...
 
X & at (std::size_t idx)
 Gets a mutable reference to the degree of freedom at the specified index. More...
 
const X & at (std::size_t idx) const
 Gets a const reference to the degree of freedom at the specified index. More...
 
const X * data () const
 Gets a pointer to the raw C-style array of the degrees of freedom. More...
 
template<std::size_t NUM = 1, typename = std::enable_if_t<(NUM <= LEN) && (NUM > 0)>>
DiscreteFunction< DIM, X, N, NUM > Components (std::size_t idx) const
 Extracts a sub-range of components from the function. More...
 
BasicVector< X, LEN > Value (std::size_t elementIdx, const Vector< DIM > &localPt) const
 Gets the function or value projection evaluated at the specified local point of the specified element. More...
 
BasicVector< X, LEN > operator() (std::size_t elementIdx, const Vector< DIM > &localPt) const
 Gets the function or value projection evaluated at the specified local point of the specified element. More...
 
BasicMatrix< X, LEN, DIM > Gradient (std::size_t elementIdx, const Vector< DIM > &localPt) const
 Gets the gradient or gradient projection of the function evaluated at the specified local point of the specified element. More...
 
BasicMatrix< X, LEN, DIM > GradientValue (std::size_t elementIdx, const Vector< DIM > &localPt) const
 Gets the gradient of the value. More...
 
std::array< FuncAndGradData< DIM, X >, LEN > ValueAndGradient (std::size_t elementIdx, const Vector< DIM > &localPt) const
 Gets the function and gradient, or value and gradient projection, of the function evaluated at the specified local point of the specified element. More...
 
std::array< BasicMatrix< X, DIM >, LEN > Hessian (std::size_t elementIdx, const Vector< DIM > &localPt) const
 Gets the Hessian or Hessian projection of the function evaluated at the specified local point of the specified element. More...
 
std::array< FuncGradAndHessianData< DIM, X >, LEN > ValueGradientAndHessian (std::size_t elementIdx, const Vector< DIM > &localPt) const
 Gets the function, gradient, and Hessian (or projections of these) of the function evaluated at the specified local point of the specified element. More...
 
iterator begin ()
 Gets an iterator to the first degree of freedom. More...
 
iterator end ()
 Gets an iterator to the 'one-past-the-end' degree of freedom. More...
 
const_iterator begin () const
 Gets a const iterator to the first degree of freedom. More...
 
const_iterator end () const
 Gets a const iterator to the 'one-past-the-end' degree of freedom. More...
 
const_iterator cbegin () const
 Gets a const iterator to the first degree of freedom. More...
 
const_iterator cend () const
 Gets a const iterator to the 'one-past-the-end' degree of freedom. More...
 
reverse_iterator rbegin () const
 Gets a reverse iterator to the last degree of freedom. More...
 
reverse_iterator rend () const
 Gets a reverse iterator to the 'one-before-the-start' degree of freedom. More...
 
const_reverse_iterator rbegin ()
 Gets a reverse const iterator to the last degree of freedom. More...
 
const_reverse_iterator rend ()
 Gets a reverse const iterator to the 'one-before-the-start' degree of freedom. More...
 
const_reverse_iterator crbegin () const
 Gets a reverse const iterator to the last degree of freedom. More...
 
const_reverse_iterator crend () const
 Gets a reverse const iterator to the 'one-before-the-start' degree of freedom. More...
 
DiscreteFunctionoperator= (const std::vector< X > &dofs)
 Sets all the degrees of freedom in the function to the specified degrees of freedom. More...
 
DiscreteFunctionoperator= (std::vector< X > &&dofs)
 Sets all the degrees of freedom in the function to the specified degrees of freedom (Moves the passed vector) More...
 
DiscreteFunction Copy () const
 Creates a copy of the current function. More...
 
DiscreteFunction< DIM, X, N, LEN > & operator*= (X constant)
 Multiplies this function by the specified constant. More...
 
DiscreteFunction< DIM, X, N, LEN > & operator/= (X constant)
 Divides this function by the specified constant. More...
 
DiscreteFunction< DIM, X, N, LEN > & operator+= (X constant)
 Adds the specified constant to this function. More...
 
DiscreteFunction< DIM, X, N, LEN > & operator-= (X constant)
 Subtracts the specified constant from this function. More...
 
DiscreteFunction< DIM, X, N, LEN > & operator+= (const DiscreteFunction< DIM, X, N, LEN > &rhs)
 Adds the specified function to this function. More...
 
DiscreteFunction< DIM, X, N, LEN > & operator-= (const DiscreteFunction< DIM, X, N, LEN > &rhs)
 Subtracts the specified function from this function. More...
 
void WriteVariable (DataFileWriter< DIM > &writer, const std::string &name) const override
 Writes the function to the specified data file. More...
 

Static Public Attributes

static constexpr std::size_t DomainDimension = DIM
 The dimension of the spacial domain the function is over. More...
 
static constexpr std::size_t Dimension = LEN
 The size of the resulting return type for the function. More...
 

Friends

template<std::size_t D, typename T , std::size_t M>
class DiscreteFunctionSpace
 

Detailed Description

template<std::size_t DIM, typename X, std::size_t N, std::size_t LEN>
class ptems::DiscreteFunction< DIM, X, N, LEN >

A function over a discrete function space.

Template Parameters
DIMThe dimension of the domain (and mesh)
XThe type of the result of the functions (double, std::complex, etc)
NThe size of the underlying vector space (N=1 for scalars)
LENThe size of the actual vector space for this component (N=1 for scalars)

Member Typedef Documentation

◆ const_iterator

template<std::size_t DIM, typename X , std::size_t N, std::size_t LEN>
typedef std::vector<X>::const_iterator< X > ptems::DiscreteFunction< DIM, X, N, LEN >::const_iterator

Type for a const iterator over the degrees of freedom of the function.

◆ const_reverse_iterator

template<std::size_t DIM, typename X , std::size_t N, std::size_t LEN>
typedef std::reverse_iterator<const_iterator>< X > ptems::DiscreteFunction< DIM, X, N, LEN >::const_reverse_iterator

Type for a const iterator over the degrees of freedom of the function in reverse.

◆ iterator

template<std::size_t DIM, typename X , std::size_t N, std::size_t LEN>
typedef std::vector<X>::iterator< X > ptems::DiscreteFunction< DIM, X, N, LEN >::iterator

Type for an iterator over the degrees of freedom of the function.

◆ reverse_iterator

template<std::size_t DIM, typename X , std::size_t N, std::size_t LEN>
typedef std::reverse_iterator<iterator>< X > ptems::DiscreteFunction< DIM, X, N, LEN >::reverse_iterator

Type for an iterator over the degrees of freedom of the function in reverse.

◆ size_type

template<std::size_t DIM, typename X , std::size_t N, std::size_t LEN>
typedef std::vector<X>::size_type ptems::DiscreteFunction< DIM, X, N, LEN >::size_type

The type to use for the number of degrees of freedom in the function.

◆ value_type

template<std::size_t DIM, typename X , std::size_t N, std::size_t LEN>
typedef X ptems::DiscreteFunction< DIM, X, N, LEN >::value_type

The value of the components of the return type of the function.

Constructor & Destructor Documentation

◆ DiscreteFunction() [1/3]

template<std::size_t DIM, typename X , std::size_t N, std::size_t LEN>
template<std::size_t S, typename = std::enable_if_t<(S == N) && (S == LEN)>>
ptems::DiscreteFunction< DIM, X, N, LEN >::DiscreteFunction ( const PDiscreteFunctionSpace< DIM, X, S > &  space)
inlineexplicit

Creates a function in the specified function space.

Parameters
spaceThe function space to create this function in

◆ DiscreteFunction() [2/3]

template<std::size_t DIM, typename X , std::size_t N, std::size_t LEN>
template<std::size_t S, typename = std::enable_if_t<(S == N) && (S == LEN)>>
ptems::DiscreteFunction< DIM, X, N, LEN >::DiscreteFunction ( const PDiscreteFunctionSpace< DIM, X, S > &  space,
value 
)
inline

Creates a function in the specified function space, with initial constant function value.

Parameters
spaceThe function space to create this function in
valueConstant value of all components of the function

◆ DiscreteFunction() [3/3]

template<std::size_t DIM, typename X , std::size_t N, std::size_t LEN>
template<std::size_t S, typename... T, typename = std::enable_if_t<(sizeof...(T) == N) && (S == N) && (S == LEN)>>
ptems::DiscreteFunction< DIM, X, N, LEN >::DiscreteFunction ( const PDiscreteFunctionSpace< DIM, X, S > &  space,
T...  values 
)
inline

Creates a function in the specified function space, with initial constant function value.

Template Parameters
TThe type of the constant values, must be convertible to X. Must have N arguments
Parameters
spaceThe function space to create this function in
valuesConstant values of the components of the function. Must have N arguments

Member Function Documentation

◆ at() [1/2]

template<std::size_t DIM, typename X , std::size_t N, std::size_t LEN>
X& ptems::DiscreteFunction< DIM, X, N, LEN >::at ( std::size_t  idx)
inline

Gets a mutable reference to the degree of freedom at the specified index.

Exceptions
std::out_of_rangeIf idx is not in the range [0, size()).
See also
operator[](std::size_t)
Parameters
idxIndex of the degree of freedom to get
Returns
Mutable value for the degree of freedom

◆ at() [2/2]

template<std::size_t DIM, typename X , std::size_t N, std::size_t LEN>
const X& ptems::DiscreteFunction< DIM, X, N, LEN >::at ( std::size_t  idx) const
inline

Gets a const reference to the degree of freedom at the specified index.

Exceptions
std::out_of_rangeIf idx is not in the range [0, size()).
See also
operator[](std::size_t) const
Parameters
idxIndex of the degree of freedom to get
Returns
Const value for the degree of freedom

◆ begin() [1/2]

template<std::size_t DIM, typename X , std::size_t N, std::size_t LEN>
iterator ptems::DiscreteFunction< DIM, X, N, LEN >::begin ( )
inline

Gets an iterator to the first degree of freedom.

Returns
Iterator pointing to the first degree of freedom

◆ begin() [2/2]

template<std::size_t DIM, typename X , std::size_t N, std::size_t LEN>
const_iterator ptems::DiscreteFunction< DIM, X, N, LEN >::begin ( ) const
inline

Gets a const iterator to the first degree of freedom.

Returns
Const iterator pointing to the first degree of freedom

◆ cbegin()

template<std::size_t DIM, typename X , std::size_t N, std::size_t LEN>
const_iterator ptems::DiscreteFunction< DIM, X, N, LEN >::cbegin ( ) const
inline

Gets a const iterator to the first degree of freedom.

Returns
Const iterator pointing to the first degree of freedom

◆ cend()

template<std::size_t DIM, typename X , std::size_t N, std::size_t LEN>
const_iterator ptems::DiscreteFunction< DIM, X, N, LEN >::cend ( ) const
inline

Gets a const iterator to the 'one-past-the-end' degree of freedom.

Returns
Const iterator pointing to the 'one-past-the-end' of the array of degrees of freedom

◆ Components()

template<std::size_t DIM, typename X , std::size_t N, std::size_t LEN>
template<std::size_t NUM = 1, typename = std::enable_if_t<(NUM <= LEN) && (NUM > 0)>>
DiscreteFunction<DIM, X, N, NUM> ptems::DiscreteFunction< DIM, X, N, LEN >::Components ( std::size_t  idx) const
inline

Extracts a sub-range of components from the function.

Template Parameters
NUMThe number of components to extract
Parameters
idxThe index of the first component to extract
Returns
A function over just the specified components

◆ Copy()

template<std::size_t DIM, typename X , std::size_t N, std::size_t LEN>
DiscreteFunction ptems::DiscreteFunction< DIM, X, N, LEN >::Copy ( ) const
inline

Creates a copy of the current function.

Returns
The copied function

◆ crbegin()

template<std::size_t DIM, typename X , std::size_t N, std::size_t LEN>
const_reverse_iterator ptems::DiscreteFunction< DIM, X, N, LEN >::crbegin ( ) const
inline

Gets a reverse const iterator to the last degree of freedom.

Returns
Reverse const iterator pointing to the last degree of freedom

◆ crend()

template<std::size_t DIM, typename X , std::size_t N, std::size_t LEN>
const_reverse_iterator ptems::DiscreteFunction< DIM, X, N, LEN >::crend ( ) const
inline

Gets a reverse const iterator to the 'one-before-the-start' degree of freedom.

Returns
Reverse const iterator pointing to the 'one-before-the-start' of the array of degrees of freedom

◆ data()

template<std::size_t DIM, typename X , std::size_t N, std::size_t LEN>
const X* ptems::DiscreteFunction< DIM, X, N, LEN >::data ( ) const
inline

Gets a pointer to the raw C-style array of the degrees of freedom.

Returns
Pointer to the first entry of the array

◆ end() [1/2]

template<std::size_t DIM, typename X , std::size_t N, std::size_t LEN>
iterator ptems::DiscreteFunction< DIM, X, N, LEN >::end ( )
inline

Gets an iterator to the 'one-past-the-end' degree of freedom.

Returns
Iterator pointing to the 'one-past-the-end' of the array of degrees of freedom

◆ end() [2/2]

template<std::size_t DIM, typename X , std::size_t N, std::size_t LEN>
const_iterator ptems::DiscreteFunction< DIM, X, N, LEN >::end ( ) const
inline

Gets a const iterator to the 'one-past-the-end' degree of freedom.

Returns
Const iterator pointing to the 'one-past-the-end' of the array of degrees of freedom

◆ Gradient()

template<std::size_t DIM, typename X , std::size_t N, std::size_t LEN>
BasicMatrix<X,LEN,DIM> ptems::DiscreteFunction< DIM, X, N, LEN >::Gradient ( std::size_t  elementIdx,
const Vector< DIM > &  localPt 
) const
inline

Gets the gradient or gradient projection of the function evaluated at the specified local point of the specified element.

The result is the Jacobian matrix; i.e, each row is the gradient of each component

Parameters
elementIdxThe index of the element
localPtThe point in the element's local coordinate system
Returns
The Jacobian of the function evaluated at the specified point

◆ GradientValue()

template<std::size_t DIM, typename X , std::size_t N, std::size_t LEN>
BasicMatrix<X,LEN,DIM> ptems::DiscreteFunction< DIM, X, N, LEN >::GradientValue ( std::size_t  elementIdx,
const Vector< DIM > &  localPt 
) const
inline

Gets the gradient of the value.

The result is the Jacobian matrix; i.e, each row is the gradient of each component

Note
This is different from Gradient for virtual element spaces, as it will give the gradient of the value projection, but the same for finite element spaces.
Parameters
elementIdxThe index of the element
localPtThe point in the element's local coordinate system
Returns
The Jacobian of the function evaluated at the specified point

◆ Hessian()

template<std::size_t DIM, typename X , std::size_t N, std::size_t LEN>
std::array<BasicMatrix<X,DIM>,LEN> ptems::DiscreteFunction< DIM, X, N, LEN >::Hessian ( std::size_t  elementIdx,
const Vector< DIM > &  localPt 
) const
inline

Gets the Hessian or Hessian projection of the function evaluated at the specified local point of the specified element.

The result is the Hessian matrix for each component of the vector

Parameters
elementIdxThe index of the element
localPtThe point in the element's local coordinate system
Returns
The Hessian of the function evaluated at the specified point

◆ operator()()

template<std::size_t DIM, typename X , std::size_t N, std::size_t LEN>
BasicVector<X,LEN> ptems::DiscreteFunction< DIM, X, N, LEN >::operator() ( std::size_t  elementIdx,
const Vector< DIM > &  localPt 
) const
inline

Gets the function or value projection evaluated at the specified local point of the specified element.

Parameters
elementIdxThe index of the element
localPtThe point in the element's local coordinate system
Returns
The function evaluated at the specified point

◆ operator*=()

template<std::size_t DIM, typename X , std::size_t N, std::size_t LEN>
DiscreteFunction<DIM, X, N, LEN>& ptems::DiscreteFunction< DIM, X, N, LEN >::operator*= ( constant)
inline

Multiplies this function by the specified constant.

Parameters
constantThe value to multiply the function by

◆ operator+=() [1/2]

template<std::size_t DIM, typename X , std::size_t N, std::size_t LEN>
DiscreteFunction<DIM, X, N, LEN>& ptems::DiscreteFunction< DIM, X, N, LEN >::operator+= ( const DiscreteFunction< DIM, X, N, LEN > &  rhs)
inline

Adds the specified function to this function.

Exceptions
std::invalid_argumentIf the specified function is from a different space than this function
std::invalid_argumentIf the specified function has a different size (number of DoFs) than this function
Parameters
rhsThe function to add

◆ operator+=() [2/2]

template<std::size_t DIM, typename X , std::size_t N, std::size_t LEN>
DiscreteFunction<DIM, X, N, LEN>& ptems::DiscreteFunction< DIM, X, N, LEN >::operator+= ( constant)
inline

Adds the specified constant to this function.

Template Parameters
TThe type of the value to multiply the function by
Parameters
constantThe value to multiply the function by

◆ operator-=() [1/2]

template<std::size_t DIM, typename X , std::size_t N, std::size_t LEN>
DiscreteFunction<DIM, X, N, LEN>& ptems::DiscreteFunction< DIM, X, N, LEN >::operator-= ( const DiscreteFunction< DIM, X, N, LEN > &  rhs)
inline

Subtracts the specified function from this function.

Exceptions
std::invalid_argumentIf the specified function is from a different space than this function
std::invalid_argumentIf the specified function has a different size (number of DoFs) than this function
Parameters
rhsThe function to subtract

◆ operator-=() [2/2]

template<std::size_t DIM, typename X , std::size_t N, std::size_t LEN>
DiscreteFunction<DIM, X, N, LEN>& ptems::DiscreteFunction< DIM, X, N, LEN >::operator-= ( constant)
inline

Subtracts the specified constant from this function.

Template Parameters
TThe type of the value to multiply the function by
Parameters
constantThe value to multiply the function by

◆ operator/=()

template<std::size_t DIM, typename X , std::size_t N, std::size_t LEN>
DiscreteFunction<DIM, X, N, LEN>& ptems::DiscreteFunction< DIM, X, N, LEN >::operator/= ( constant)
inline

Divides this function by the specified constant.

Parameters
constantThe value to multiply the function by

◆ operator=() [1/3]

template<std::size_t DIM, typename X , std::size_t N, std::size_t LEN>
template<std::size_t S, typename = std::enable_if_t<(S == N) && (S == LEN)>>
DiscreteFunction& ptems::DiscreteFunction< DIM, X, N, LEN >::operator= ( const PDiscreteFunctionSpace< DIM, X, S > &  space)
inline

Reset this function to be a function over the specified space.

Parameters
spaceThe function space to define this function in
Returns
Reference to this

◆ operator=() [2/3]

template<std::size_t DIM, typename X , std::size_t N, std::size_t LEN>
DiscreteFunction& ptems::DiscreteFunction< DIM, X, N, LEN >::operator= ( const std::vector< X > &  dofs)
inline

Sets all the degrees of freedom in the function to the specified degrees of freedom.

Parameters
dofsThe vector of the degrees of freedom for the function

◆ operator=() [3/3]

template<std::size_t DIM, typename X , std::size_t N, std::size_t LEN>
DiscreteFunction& ptems::DiscreteFunction< DIM, X, N, LEN >::operator= ( std::vector< X > &&  dofs)
inline

Sets all the degrees of freedom in the function to the specified degrees of freedom (Moves the passed vector)

Parameters
dofsThe vector of the degrees of freedom for the function

◆ operator[]() [1/2]

template<std::size_t DIM, typename X , std::size_t N, std::size_t LEN>
X& ptems::DiscreteFunction< DIM, X, N, LEN >::operator[] ( std::size_t  idx)
inline

Gets a mutable reference to the degree of freedom at the specified index.

Warning
This function DOES NOT perform range checking on the input index. As such, care must be used when calling this function (this is to be consistent with STL containers such as std::vector).
See also
at(std::size_t)
Parameters
idxIndex of the degree of freedom to get
Returns
Mutable value for the degree of freedom

◆ operator[]() [2/2]

template<std::size_t DIM, typename X , std::size_t N, std::size_t LEN>
const X& ptems::DiscreteFunction< DIM, X, N, LEN >::operator[] ( std::size_t  idx) const
inline

Gets a const reference to the degree of freedom at the specified index.

Warning
This function DOES NOT perform range checking on the input index. As such, care must be used when calling this function (this is to be consistent with STL containers such as std::vector).
See also
at(std::size_t) const
Parameters
idxIndex of the degree of freedom to get
Returns
Const value for the degree of freedom

◆ rbegin() [1/2]

template<std::size_t DIM, typename X , std::size_t N, std::size_t LEN>
const_reverse_iterator ptems::DiscreteFunction< DIM, X, N, LEN >::rbegin ( )
inline

Gets a reverse const iterator to the last degree of freedom.

Returns
Reverse const iterator pointing to the last degree of freedom

◆ rbegin() [2/2]

template<std::size_t DIM, typename X , std::size_t N, std::size_t LEN>
reverse_iterator ptems::DiscreteFunction< DIM, X, N, LEN >::rbegin ( ) const
inline

Gets a reverse iterator to the last degree of freedom.

Returns
Reverse iterator pointing to the last degree of freedom

◆ rend() [1/2]

template<std::size_t DIM, typename X , std::size_t N, std::size_t LEN>
const_reverse_iterator ptems::DiscreteFunction< DIM, X, N, LEN >::rend ( )
inline

Gets a reverse const iterator to the 'one-before-the-start' degree of freedom.

Returns
Reverse const iterator pointing to the 'one-before-the-start' of the array of degrees of freedom

◆ rend() [2/2]

template<std::size_t DIM, typename X , std::size_t N, std::size_t LEN>
reverse_iterator ptems::DiscreteFunction< DIM, X, N, LEN >::rend ( ) const
inline

Gets a reverse iterator to the 'one-before-the-start' degree of freedom.

Returns
Reverse iterator pointing to the 'one-before-the-start' of the array of degrees of freedom

◆ size()

template<std::size_t DIM, typename X , std::size_t N, std::size_t LEN>
size_type ptems::DiscreteFunction< DIM, X, N, LEN >::size ( ) const
inline

Gets the number of degrees of freedom in the function.

Returns
Number of degrees of freedom

◆ Value()

template<std::size_t DIM, typename X , std::size_t N, std::size_t LEN>
BasicVector<X,LEN> ptems::DiscreteFunction< DIM, X, N, LEN >::Value ( std::size_t  elementIdx,
const Vector< DIM > &  localPt 
) const
inline

Gets the function or value projection evaluated at the specified local point of the specified element.

Parameters
elementIdxThe index of the element
localPtThe point in the element's local coordinate system
Returns
The function evaluated at the specified point

◆ ValueAndGradient()

template<std::size_t DIM, typename X , std::size_t N, std::size_t LEN>
std::array<FuncAndGradData<DIM, X>,LEN> ptems::DiscreteFunction< DIM, X, N, LEN >::ValueAndGradient ( std::size_t  elementIdx,
const Vector< DIM > &  localPt 
) const
inline

Gets the function and gradient, or value and gradient projection, of the function evaluated at the specified local point of the specified element.

Parameters
elementIdxThe index of the element
localPtThe point in the element's local coordinate system
Returns
The value and gradient of the function evaluated at the specified point

◆ ValueGradientAndHessian()

template<std::size_t DIM, typename X , std::size_t N, std::size_t LEN>
std::array<FuncGradAndHessianData<DIM, X>,LEN> ptems::DiscreteFunction< DIM, X, N, LEN >::ValueGradientAndHessian ( std::size_t  elementIdx,
const Vector< DIM > &  localPt 
) const
inline

Gets the function, gradient, and Hessian (or projections of these) of the function evaluated at the specified local point of the specified element.

Parameters
elementIdxThe index of the element
localPtThe point in the element's local coordinate system
Returns
The value, gradient, and Hessian of the function evaluated at the specified point

◆ WriteVariable()

template<std::size_t DIM, typename X , std::size_t N, std::size_t LEN>
void ptems::DiscreteFunction< DIM, X, N, LEN >::WriteVariable ( DataFileWriter< DIM > &  writer,
const std::string name 
) const
inlineoverridevirtual

Writes the function to the specified data file.

Parameters
writerWriter for data file to write to
nameThe name to use for the output variable

Implements ptems::WritableVariable< DIM >.

Member Data Documentation

◆ Dimension

template<std::size_t DIM, typename X , std::size_t N, std::size_t LEN>
constexpr std::size_t ptems::DiscreteFunction< DIM, X, N, LEN >::Dimension = LEN
staticconstexpr

The size of the resulting return type for the function.

◆ DomainDimension

template<std::size_t DIM, typename X , std::size_t N, std::size_t LEN>
constexpr std::size_t ptems::DiscreteFunction< DIM, X, N, LEN >::DomainDimension = DIM
staticconstexpr

The dimension of the spacial domain the function is over.


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