18 "expression",
"FunctionExpression",
"function expression");
19 params.
addParam<std::string>(
"name",
"result",
"Name of output reporter.");
20 params.
addParam<std::vector<std::string>>(
21 "vector_reporter_symbols", {},
"Expression symbol for each reporter");
22 params.
addParam<std::vector<std::string>>(
23 "scalar_reporter_symbols",
25 "Expression symbol for each scalar reporter, i.e. postprocessors");
26 params.
addParam<std::vector<std::string>>(
29 "Vector of constants used in the parsed function (use this for kB etc.)");
30 params.
addParam<std::vector<ReporterName>>(
"scalar_reporter_names",
31 "Scalar reporter names to apply function to.");
32 params.
addParam<std::vector<std::string>>(
33 "constant_expressions",
35 "Vector of values for the constants in constant_names (can be an FParser expression)");
37 "use_t",
false,
"Make time (t) variables available in the function expression.");
44 _use_t(getParam<bool>(
"use_t")),
45 _vector_reporter_symbols(getParam<
std::vector<
std::string>>(
"vector_reporter_symbols")),
46 _scalar_reporter_symbols(getParam<
std::vector<
std::string>>(
"scalar_reporter_symbols"))
53 const std::vector<ReporterName> scalar_reporter_names(
54 getParam<std::vector<ReporterName>>(
"scalar_reporter_names"));
58 "scalar_reporter_names and scalar_reporter_symbols must be the same size: Number " 59 "of scalar_reporter_names=",
60 scalar_reporter_names.size(),
61 "; Number of scalar_reporter_symbols=",
71 std::string symbol_str;
80 symbol_str += (symbol_str.empty() ?
"" :
",") + std::string(
"t");
83 _func_F = std::make_shared<SymFunction>();
85 getParam<std::string>(
"expression"),
87 getParam<std::vector<std::string>>(
"constant_names"),
88 getParam<std::vector<std::string>>(
"constant_expressions"),
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 ...
const T & getParam(const std::string &name) const
Retrieve a parameter for the object.
Reporter object that has a single execution of the "execute" method for for each execute flag...
const ReporterMode REPORTER_MODE_ROOT
std::vector< const Real * > _scalar_reporter_data
input scalar reporter vectors
const InputParameters & parameters() const
Get the parameters of the object.
const Parallel::Communicator & comm() const
static InputParameters validParams()
SymFunctionPtr _func_F
function parser object
const std::vector< std::string > _scalar_reporter_symbols
static InputParameters validParams()
void parsedFunctionSetup(SymFunctionPtr &function, const std::string &expression, const std::string &variables, const std::vector< std::string > &constant_names, const std::vector< std::string > &constant_expressions, const libMesh::Parallel::Communicator &comm) const
Performs setup steps on a SymFunction.
const std::vector< std::string > _vector_reporter_symbols
Get symbols to corresponding reporter names need symbols because reporter names have a "/" and that w...
std::vector< GenericReal< is_ad > > _func_params
Array to stage the parameters passed to the functions when calling Eval.
const bool _use_t
whether time is part of the parsed expression
ParsedReporterBase(const InputParameters ¶meters)
static InputParameters validParams()
auto index_range(const T &sizable)