DOLFINx 0.9.0
DOLFINx C++ interface
Loading...
Searching...
No Matches
Constant< T > Class Template Reference

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

#include <Constant.h>

Public Types

using value_type = T
 Field type.
 

Public Member Functions

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

Public Attributes

std::vector< value_typevalue
 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 ( value_type 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 value_type > 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 value_type > 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 files: