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.7.3
DOLFINx C++ interface
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
Constant< T > Class Template Reference

Constant value which can be attached to a Form. More...

#include <Constant.h>

Public Member Functions

 Constant (T c)
 Create a rank-0 (scalar-valued) constant.
 
 Constant (std::span< const T > c)
 Create a rank-1 (vector-valued) constant.
 
 Constant (std::span< const T > c, std::span< const std::size_t > shape)
 Create a rank-d constant.
 

Public Attributes

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

Detailed Description

template<dolfinx::scalar 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.

Template Parameters
TScalar type of the Constant.

Constructor & Destructor Documentation

◆ Constant() [1/3]

template<dolfinx::scalar T>
Constant ( c)
inlineexplicit

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

Parameters
[in]cValue of the constant

◆ Constant() [2/3]

template<dolfinx::scalar T>
Constant ( std::span< const T >  c)
inlineexplicit

Create a rank-1 (vector-valued) constant.

Parameters
[in]cValue of the constant

◆ Constant() [3/3]

template<dolfinx::scalar T>
Constant ( std::span< const T >  c,
std::span< const std::size_t >  shape 
)
inline

Create a rank-d constant.

Parameters
[in]cValue of the Constant (row-majors storage)
[in]shapeShape of the Constant

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