Note: this is documentation for an old release. View the latest documentation at docs.fenicsproject.org/dolfinx/v0.9.0/cpp/doxygen/d6/d06/classdolfinx_1_1fem_1_1Constant.html
DOLFINx  0.4.1
DOLFINx C++ interface
Public Member Functions | Public Attributes | List of all members
Constant< T > Class Template Reference

Constant value which can be attached to a Form. Constants may be scalar (rank 0), vector (rank 1), or tensor valued. More...

#include <Constant.h>

Public Member Functions

template<typename = std::enable_if_t< std::is_arithmetic_v< T> || std::is_same_v<T, std::complex<float>> || std::is_same_v<T, std::complex<double>>>>
 Constant (T c)
 Create a rank-0 (scalar-valued) constant. More...
 
 Constant (const xt::xarray< T > &c)
 Create a rank-d constant. More...
 

Public Attributes

std::vector< int > shape
 Shape.
 
std::vector< T > value
 Values, stored as a row-major flattened array.
 

Detailed Description

template<typename T>
class dolfinx::fem::Constant< T >

Constant value which can be attached to a Form. Constants may be scalar (rank 0), vector (rank 1), or tensor valued.

Constructor & Destructor Documentation

◆ Constant() [1/2]

Constant ( c)
inline

Create a rank-0 (scalar-valued) constant.

Parameters
[in]cValue of the constant

◆ Constant() [2/2]

Constant ( const xt::xarray< T > &  c)
inline

Create a rank-d constant.

Parameters
[in]cValue of the constant

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