DOLFINx
0.1.0
DOLFINx C++ interface
|
9 #include <dolfinx/common/array2d.h>
30 :
shape({(int)c.rows(), (int)c.cols()}),
value(c.rows() * c.cols())
32 for (
int i = 0; i < c.rows(); ++i)
33 for (
int j = 0; j < c.cols(); ++j)
34 value[i * c.cols() + j] = c(i, j);
Constant(T c)
Create a rank-0 (scalar-valued) constant.
Definition: Constant.h:23
Constant(std::vector< int > shape, std::vector< T > value)
Create an arbitrary rank constant. Data layout is row-major (C style).
Definition: Constant.h:38
Constant(const array2d< T > &c)
Create a rank-2 constant.
Definition: Constant.h:29
Constant(const std::vector< T > &c)
Create a rank-1 (vector-valued) constant.
Definition: Constant.h:26
std::vector< T > value
Values, stored as a flattened array.
Definition: Constant.h:48
Finite element method functionality.
Definition: assemble_matrix_impl.h:22
This class provides a dynamic 2-dimensional row-wise array data structure.
Definition: array2d.h:20
A constant value which can be attached to a Form. Constants may be scalar (rank 0),...
Definition: Constant.h:18
std::vector< int > shape
Shape.
Definition: Constant.h:45