25#include "neml2/models/solid_mechanics/Normality.h"
35 options.doc() =
"Store the first derivatives of a scalar-valued function in given variables, "
36 "i.e. \\f$ u_i = \\dfrac{f(\\boldsymbol{v})}{v_i} \\f$.";
38 options.set<std::string>(
"model");
39 options.set(
"model").doc() =
"The model which evaluates the scalar-valued function";
42 options.set(
"function").doc() =
"Function to take derivative";
44 options.set<std::vector<VariableName>>(
"from");
45 options.set(
"from").doc() =
"Function arguments to take derivatives w.r.t.";
47 options.set<std::vector<VariableName>>(
"to");
48 options.set(
"to").doc() =
"Variables to store the first derivatives";
55 _model(register_model<
Model>(options.get<std::
string>(
"model"), 1)),
59 const auto from =
options.get<std::vector<VariableName>>(
"from");
60 const auto to =
options.get<std::vector<VariableName>>(
"to");
62 "The conjugate pairs should have a one-to-one correspondance. ",
64 " variables are being mapped to ",
67 for (
size_t i = 0;
i <
from.size();
i++)
The wrapper (decorator) for cross-referencing unresolved values at parse time.
Definition CrossRef.h:52
The accessor containing all the information needed to access an item in a LabeledAxis.
Definition LabeledAxisAccessor.h:44
TorchSize storage_size() const
Get the (total) storage size of this axis.
Definition LabeledAxis.h:142
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
virtual std::tuple< LabeledVector, LabeledMatrix, LabeledTensor3D > value_and_dvalue_and_d2value(const LabeledVector &in)
Convenient shortcut to construct and return the model's value, first and second derivative.
Definition Model.cxx:366
virtual std::tuple< LabeledVector, LabeledMatrix > value_and_dvalue(const LabeledVector &in)
Convenient shortcut to construct and return the model value and its derivative.
Definition Model.cxx:357
static OptionSet expected_options()
Definition Model.cxx:33
Definition Normality.h:32
Model & _model
The model which evaluates the potential function.
Definition Normality.h:43
const VariableName _f
The potential function.
Definition Normality.h:46
Normality(const OptionSet &options)
Definition Normality.cxx:53
static OptionSet expected_options()
Definition Normality.cxx:32
std::map< VariableName, Variable< BatchTensor > * > _conjugate_pairs
Definition Normality.h:48
void set_value(bool out, bool dout_din, bool d2out_din2) override
The flow direction.
Definition Normality.cxx:75
A custom map-like data structure. The keys are strings, and the values can be nonhomogeneously typed.
Definition OptionSet.h:59
LabeledMatrix & derivative_storage()
Definition VariableStore.h:127
Variable< T > & declare_output_variable(S &&... name)
Declare an output variable.
Definition VariableStore.h:205
LabeledAxis & output_axis()
Definition VariableStore.h:97
Storage< VariableName, VariableBase > & input_views()
Definition VariableStore.h:103
LabeledTensor3D & second_derivative_storage()
Definition VariableStore.h:133
LabeledAxis & input_axis()
Definition VariableStore.h:91
Definition CrossRef.cxx:32
void neml_assert_dbg(bool assertion, Args &&... args)
Definition error.h:85
void neml_assert(bool assertion, Args &&... args)
Definition error.h:73