Loading...
Searching...
No Matches
Constant< T > Class Template Reference

Constant (in space) 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_type > | 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 (in space) value which can be attached to a Form.

Constants may be scalar (rank 0), vector (rank 1), or tensor-valued.

Template Parameters

  T | Scalar type of the Constant.

## Constructor & Destructor Documentation

## Constant() [1/3]

template<dolfinx::scalar T>

Constant | ( | value_type | c | ) |

inline explicit

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

Parameters

  [in] | c | Value of the constant.

## Constant() [2/3]

template<dolfinx::scalar T>

Constant | ( | std::span< const value_type > | c | ) |

inline explicit

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

Parameters

  [in] | c | Value 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] | c | Value of the Constant (row-majors storage)
  [in] | shape | Shape of the Constant

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

- /build/fenics-dolfinx-PdyzCE/fenics-dolfinx-0.10.0.post5/cpp/dolfinx/fem/Constant.h