The constructors for Constant don't seem to provide a way to create a 1D vector valued constant:
/// Create scalar constant
explicit Constant(double value);
/// Create vector constant (dim = 2)
Constant(double value0, double value1);
/// Create vector constant (dim = 3)
Constant(double value0, double value1, double value2);
The following two look promising, but haven't helped me in applying a 1D vector dirichlet BC.
/// Create vector-valued constant
explicit Constant(std::vector<double> values);
/// Create tensor-valued constant for flattened array of values
Constant(std::vector<std::size_t> value_shape,
std::vector<double> values);
When I set the boundary condition equal to a Constant, I keep getting a runtime error:
*** -------------------------------------------------------------------------
*** Error: Unable to create Dirichlet boundary condition.
*** Reason: Expecting a vector-valued boundary value but given function is scalar.
*** Where: This error was encountered inside DirichletBC.cpp.
*** Process: 0
*** -------------------------------------------------------------------------
How should I do this? Thanks!