14 #include "neml2/tensors/R2.h" 15 #include "neml2/tensors/functions/imap.h" 24 OptionSet options = Model::expected_options();
25 options.doc() =
"Compute the rate of a rank two tensor given its increment and the time step.";
26 options.add_input(
"increment",
"Increment of the rank two tensor");
27 options.add_input(
"time",
"t",
"Current time");
28 options.add_output(
"rate",
"Rate of the rank two tensor");
34 _delta(declare_input_variable<R2>(
"increment")),
35 _t(declare_input_variable<Scalar>(
"t")),
36 _t_n(declare_input_variable<Scalar>(history_name(_t.
name(), 1))),
37 _rate(declare_output_variable<R2>(
"rate"))
56 #endif // NEML2_ENABLED static OptionSet expected_options()
Variable< R2 > & _rate
Rate.
register_NEML2_object(LibtorchModel)
void set_value(bool out, bool dout_din, bool d2out_din2) override
const Variable< Scalar > & _t_n
R2IncrementToRate(const OptionSet &options)
const Variable< Scalar > & _t
Time.
const Variable< R2 > & _delta
Increment of the rank two tensor.