12 #include "metaphysicl/raw_type.h" 23 "AD functors to regular functors");
24 params.
addParam<std::vector<MooseFunctorName>>(
25 "reg_props_in", {},
"The names of the regular functors to convert to AD functors");
26 params.
addParam<std::vector<MooseFunctorName>>(
27 "ad_props_out", {},
"The names of the output AD functors");
28 params.
addParam<std::vector<MooseFunctorName>>(
29 "ad_props_in", {},
"The names of the AD functors to convert to regular functors");
30 params.
addParam<std::vector<MooseFunctorName>>(
31 "reg_props_out", {},
"The names of the output regular functors");
40 auto reg_props_in = getParam<std::vector<MooseFunctorName>>(
"reg_props_in");
41 auto ad_props_out = getParam<std::vector<MooseFunctorName>>(
"ad_props_out");
42 auto ad_props_in = getParam<std::vector<MooseFunctorName>>(
"ad_props_in");
43 auto reg_props_out = getParam<std::vector<MooseFunctorName>>(
"reg_props_out");
46 if (reg_props_in.size() != ad_props_out.size())
48 "The number of output AD functors must match the number of input regular " 49 "functors, which is " +
50 std::to_string(reg_props_in.size()));
52 if (ad_props_in.size() != reg_props_out.size())
54 "The number of output regular functors must match the number of input AD " 55 "functors, which is " +
56 std::to_string(ad_props_in.size()));
62 if (reg_props_in[i] == ad_props_out[j])
64 "Functor names may not overlap between reg_props_in and ad_props_out");
68 if (reg_props_in[i] == reg_props_out[j])
70 "Functor names may not overlap between reg_props_in and reg_props_out");
74 if (ad_props_in[i] == reg_props_out[j])
76 "Functor names may not overlap between ad_props_in and reg_props_out");
80 if (ad_props_in[i] == ad_props_out[j])
82 "Functor names may not overlap between ad_props_in and ad_props_out");
87 const auto & reg_functor = getFunctor<T>(reg_props_in[i]);
88 addFunctorProperty<typename Moose::ADType<T>::type>(
91 {
return reg_functor(r, t); },
98 const auto & ad_functor = getFunctor<typename Moose::ADType<T>::type>(ad_props_in[i]);
99 addFunctorProperty<T>(
101 [&ad_functor](
const auto & r,
const auto & t) -> T
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 ...
static InputParameters validParams()
MooseEnumIterator begin() const
Returns a begin/end iterator to all of the set values in the enum.
MooseEnumIterator end() const
registerMooseObject("MooseApp", FunctorADConverter)
static InputParameters validParams()
FunctorADConverterTempl(const InputParameters ¶meters)
FunctorMaterials compute functor material properties.
const ExecFlagEnum & _execute_enum
Execute settings for this object.
This material converts regular functors to AD functors and AD functors to regular functors...
auto index_range(const T &sizable)