25#include "neml2/tensors/user_tensors/FillR2.h"
35 options.
doc() =
"Construct a R2 with a vector of Scalars. The vector length must be 1, 3, 6, or "
36 "9. When vector length is 1, the Scalar value is used to fill the diagonals; "
37 "when vector length is 3, the Scalar values are used to fill the respective "
38 "diagonal entries; when vector length is 6, the Scalar values are used to fill "
39 "the tensor following the Voigt notation; when vector length is 9, the Scalar "
40 "values are used to fill the tensor in the row-major fashion.";
42 options.
set<std::vector<CrossRef<Scalar>>>(
"values");
43 options.
set(
"values").doc() =
"Scalars used to fill the R2";
59 else if (
values.size() == 3)
61 else if (
values.size() == 6)
63 else if (
values.size() == 9)
75 "Number of values must be 1, 3, 6, or 9, but ",
77 " values are provided.");
The wrapper (decorator) for cross-referencing unresolved values at parse time.
Definition CrossRef.h:52
Create a filled R2 from the input file.
Definition FillR2.h:37
FillR2(const OptionSet &options)
Construct a new FillR2 object.
Definition FillR2.cxx:48
static OptionSet expected_options()
Definition FillR2.cxx:32
A custom map-like data structure. The keys are strings, and the values can be nonhomogeneously typed.
Definition OptionSet.h:59
const std::string & doc() const
A readonly reference to the option set's docstring.
Definition OptionSet.h:91
T & set(const std::string &)
Definition OptionSet.h:436
static R2 fill(const Real &a, const torch::TensorOptions &options=default_tensor_options())
Fill the diagonals with a11 = a22 = a33 = a.
Definition R2Base.cxx:40
A basic R2.
Definition R2.h:42
R2(const SR2 &S)
Form a full R2 from a symmetric tensor.
Definition R2.cxx:38
The (logical) scalar.
Definition Scalar.h:38
Definition UserTensor.h:33
static OptionSet expected_options()
Definition UserTensor.cxx:30
Definition CrossRef.cxx:32
void neml_assert(bool assertion, Args &&... args)
Definition error.h:73