25#include "neml2/models/solid_mechanics/crystal_plasticity/FixOrientation.h"
27#include "neml2/tensors/tensors.h"
28#include "neml2/misc/math.h"
40 "Checks the value of the modified Rodrigues parameter by checking if "
41 "\\f$ \\left\\lVert r \\right\\rVert > t \\f$, with \\f$ t \\f$ a threshold value set "
42 "to 1.0 by default and replacing all the orientations that exceed this limit "
43 "with their shadow parameters values.";
46 options.set(
"input_orientation").doc() =
"Name of input tensor of orientations to operate on.";
49 options.set(
"output_orientation").doc() =
"Name of output tensor";
52 options.set(
"threshold").doc() =
"Threshold value for translating to the shadow parameters";
59 _output(declare_output_variable<
Rot>(
"output_orientation")),
60 _input(declare_input_variable<
Rot>(
"input_orientation")),
61 _threshold(options.get<
Real>(
"threshold"))
The wrapper (decorator) for cross-referencing unresolved values at parse time.
Definition CrossRef.h:52
Swap orientation plane when the singularity at is met with the modified Rodrigues vector.
Definition FixOrientation.h:41
Variable< Rot > & _output
Corrected MRP representation.
Definition FixOrientation.h:51
const Variable< Rot > & _input
MRP representation of orientations.
Definition FixOrientation.h:54
Real _threshold
Threshold for making the swap.
Definition FixOrientation.h:57
FixOrientation(const OptionSet &options)
Definition FixOrientation.cxx:57
static OptionSet expected_options()
Definition FixOrientation.cxx:35
void set_value(bool out, bool dout_din, bool d2out_din2) override
The map between input -> output, and optionally its derivatives.
Definition FixOrientation.cxx:66
The accessor containing all the information needed to access an item in a LabeledAxis.
Definition LabeledAxisAccessor.h:44
The base class for all constitutive models.
Definition Model.h:53
const torch::TensorOptions & options() const
This model's tensor options.
Definition Model.h:116
static OptionSet expected_options()
Definition Model.cxx:33
A custom map-like data structure. The keys are strings, and the values can be nonhomogeneously typed.
Definition OptionSet.h:59
static R2 identity(const torch::TensorOptions &options=default_tensor_options())
Identity.
Definition R2Base.cxx:170
Rotation stored as modified Rodrigues parameters.
Definition Rot.h:49
Derived where(const torch::Tensor &condition, const Derived &a, const Derived &b)
Definition BatchTensorBase.h:396
Definition CrossRef.cxx:32
void neml_assert_dbg(bool assertion, Args &&... args)
Definition error.h:85
LabeledAxisAccessor VariableName
Definition Variable.h:35