25#include "neml2/tensors/user_tensors/FillSR2.h"
35 options.
doc() =
"Construct a R2 with a vector of Scalars. The vector length must be 1, 3, or 6. "
36 "See the full documentation on neml2::SR2 on the dispatch of fill method. When "
37 "vector length is 1, the Scalar value is used to fill the diagonals; when vector "
38 "length is 3, the Scalar values are used to fill the respective diagonal "
39 "entries; when vector length is 6, the Scalar values are used to fill the tensor "
40 "following the Voigt notation.";
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)
65 false,
"Number of values must be 1, 3, or 6, but ",
values.size(),
" values are provided.");
The wrapper (decorator) for cross-referencing unresolved values at parse time.
Definition CrossRef.h:52
Create a filled SR2 from the input file.
Definition FillSR2.h:37
FillSR2(const OptionSet &options)
Construct a new FillSR2 object.
Definition FillSR2.cxx:48
static OptionSet expected_options()
Definition FillSR2.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
The (logical) symmetric second order tensor.
Definition SR2.h:46
SR2(const R2 &T)
Symmetrize an R2 then fill.
Definition SR2.cxx:40
static SR2 fill(const Real &a, const torch::TensorOptions &options=default_tensor_options())
Fill the diagonals with a11 = a22 = a33 = a.
Definition SR2.cxx:46
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