25#include "neml2/models/ForceRate.h"
26#include "neml2/tensors/SSR4.h"
38 options.
doc() =
"Calculate the first order discrete time derivative of a force variable as \\f$ "
39 "\\dot{f} = \\frac{f-f_n}{t-t_n} \\f$, where \\f$ f \\f$ is the force variable, "
40 "and \\f$ t \\f$ is time.";
43 options.
set(
"force").doc() =
"The force variable to take time derivative with";
46 options.
set(
"time").doc() =
"Time";
54 _df_dt(declare_output_variable<T>(
55 options.get<
VariableName>(
"force").with_suffix(
"_rate").on(
"forces"))),
56 _f(declare_input_variable<T>(options.get<
VariableName>(
"force").on(
"forces"))),
57 _fn(declare_input_variable<T>(options.get<
VariableName>(
"force").on(
"old_forces"))),
59 _tn(declare_input_variable<
Scalar>(options.get<
VariableName>(
"time").on(
"old_forces")))
75 auto I = T::identity_map(options());
79 _df_dt.d(_f) =
I /
dt;
80 _df_dt.d(_fn) = -
I /
dt;
81 _df_dt.d(_t) = -
df /
dt /
dt;
82 _df_dt.d(_tn) =
df /
dt /
dt;
87 _df_dt.d(_f, _t) = -
I /
dt /
dt;
88 _df_dt.d(_f, _tn) =
I /
dt /
dt;
90 _df_dt.d(_fn, _t) =
I /
dt /
dt;
91 _df_dt.d(_fn, _tn) = -
I /
dt /
dt;
93 _df_dt.d(_t, _f) = -
I /
dt /
dt;
94 _df_dt.d(_t, _fn) =
I /
dt /
dt;
95 _df_dt.d(_t, _t) = 2 *
df /
dt /
dt /
dt;
96 _df_dt.d(_t, _tn) = -2 *
df /
dt /
dt /
dt;
98 _df_dt.d(_tn, _f) =
I /
dt /
dt;
99 _df_dt.d(_tn, _fn) = -
I /
dt /
dt;
100 _df_dt.d(_tn, _t) = -2 *
df /
dt /
dt /
dt;
101 _df_dt.d(_tn, _tn) = 2 *
df /
dt /
dt /
dt;
The wrapper (decorator) for cross-referencing unresolved values at parse time.
Definition CrossRef.h:52
ForceRate(const OptionSet &options)
Definition ForceRate.cxx:52
static OptionSet expected_options()
Definition ForceRate.cxx:35
void set_value(bool out, bool dout_din, bool d2out_din2) override
The map between input -> output, and optionally its derivatives.
Definition ForceRate.cxx:65
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
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
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) scalar.
Definition Scalar.h:38
Definition CrossRef.cxx:32