DOLFIN-X
DOLFIN-X C++ interface
|
31 Eigen::Array<T, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor>>& c)
32 :
shape({(int)c.rows(), (int)c.cols()}),
value(c.rows() * c.cols())
34 for (
int i = 0; i < c.rows(); ++i)
35 for (
int j = 0; j < c.cols(); ++j)
36 value[i * c.cols() + j] = c(i, j);
std::vector< int > shape
Shape.
Definition: Constant.h:47
Constant(T c)
Create a rank-0 (scalar-valued) constant.
Definition: Constant.h:23
A constant value which can be attached to a Form. Constants may be scalar (rank 0),...
Definition: Constant.h:19
Constant(std::vector< int > shape, std::vector< T > value)
Create an arbitrary rank constant. Data layout is row-major (C style).
Definition: Constant.h:40
Functions tools, including FEM functions and pointwise defined functions.
Definition: assembler.h:19
std::vector< T > value
Values, stored as a flattened array.
Definition: Constant.h:50
Constant(const std::vector< T > &c)
Create a rank-1 (vector-valued) constant.
Definition: Constant.h:26
Constant(const Eigen::Ref< Eigen::Array< T, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor >> &c)
Create a rank-2 constant.
Definition: Constant.h:29