23 "Coupled function to evaluate with values from v");
27 "If provided, an entry per couple variable specifies " 28 "the function argument it should apply to.");
29 params.
addRequiredParam<MaterialPropertyName>(
"prop_name",
"Output property name");
32 "List of up to four coupled variables that are substituted for x,y,z, and t " 33 "in the coupled function (or the order chosen using the `parameter_order` parameter)");
41 _prop(declareGenericProperty<
Real, is_ad>(getParam<MaterialPropertyName>(
"prop_name"))),
42 _function(getFunction(
"function")),
43 _vals(coupledGenericValues<is_ad>(
"v")),
44 _nvals(coupledComponents(
"v"))
47 paramError(
"v",
"Couple a maximum of four variables");
49 const auto & param_order = getParam<MultiMooseEnum>(
"parameter_order");
52 if (param_order.size() == 0)
55 else if (param_order.size() ==
_nvals)
58 _order.push_back(param_order.get(i));
60 std::set<unsigned int> check_doubles(
_order.begin(),
_order.end());
61 if (check_doubles.size() !=
_nvals)
62 paramError(
"parameter_order",
"You must not repeat any positions.");
66 "Specify either as many items as coupled variables, or none at all for the default " 79 const auto & j = _order[i];
81 p(j) = (*_vals[i])[_qp];
86 _prop[_qp] = _function.value(t, p);
Moose::GenericType< Real, is_ad > GenericReal
void computeQpProperties() override
Users must override this method.
registerMooseObject("MooseApp", CoupledValueFunctionMaterial)
unsigned int _nvals
number of coupled variables
static InputParameters validParams()
typename std::conditional< is_ad, typename ADType< T >::type, T >::type GenericType
static InputParameters validParams()
CoupledValueFunctionMaterialTempl(const InputParameters ¶meters)
void paramError(const std::string ¶m, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
Materials compute MaterialProperties.
Compute a function value from coupled variables.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::vector< unsigned int > _order
mapping of variables to function parameters
IntRange< T > make_range(T beg, T end)
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type...