25#include "neml2/models/ConstantParameter.h"
35 options.
doc() =
"A parameter that is just a constant value, generally used to refer to a "
36 "parameter in more than one downstream object.";
39 options.
set(
"value").doc() =
"The constant value of the parameter";
46 _value(
this->
template declare_parameter<T>(
"value",
"value"))
58 if (
const auto value = this->nl_param(
"value"))
59 this->_p.d(*value) = T::identity_map(this->options());
65#define CONSTANTPARAMETER_REGISTER(T) \
66 register_NEML2_object_alias(T##ConstantParameter, #T "ConstantParameter")
67FOR_ALL_FIXEDDIMTENSOR(CONSTANTPARAMETER_REGISTER);
ConstantParameter(const OptionSet &options)
Definition ConstantParameter.cxx:44
static OptionSet expected_options()
Definition ConstantParameter.cxx:32
void set_value(bool out, bool dout_din, bool d2out_din2) override
The map between input -> output, and optionally its derivatives.
Definition ConstantParameter.cxx:52
The wrapper (decorator) for cross-referencing unresolved values at parse time.
Definition CrossRef.h:52
The base class for nonlinear parameters.
Definition NonlinearParameter.h:51
static OptionSet expected_options()
Definition NonlinearParameter.cxx:31
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
Definition CrossRef.cxx:32