19 "Use a parsed function to iterate through a vector and reduce it to a scalar.");
21 "Reporter name with vector to reduce.");
23 "Value to intialize the reduction with.");
27 params.
set<std::vector<std::string>>(
"vector_reporter_symbols") = {
"reduction_value",
38 _initial_reduction_value(getParam<Real>(
"initial_reduction_value")),
39 _vector_reporter_data(
40 getReporterValueByName<
std::vector<Real>>(getParam<
ReporterName>(
"vector_reporter_name"))),
44 std::string function = getParam<std::string>(
"expression");
46 if (function.find(
"reduction_value") == std::string::npos ||
47 function.find(
"indexed_value") == std::string::npos)
50 "Parsed function must contain the two symbols 'reduction_value' and 'indexed_value'.");
registerMooseObject("MooseApp", ParsedVectorRealReductionReporter)
const ReporterMode REPORTER_MODE_ROOT
std::vector< GenericReal< is_ad > > _func_params
Array to stage the parameters passed to the functions when calling Eval.
GenericReal< is_ad > evaluate(SymFunctionPtr &, const std::string &object_name="")
Evaluate FParser object and check EvalError.
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 ...
Reporter containing operation between vectors from another Reporter.
const bool _use_t
whether time is part of the parsed expression
SymFunctionPtr _func_F
function parser object
static InputParameters validParams()
Reporter performing a reduction on a vector using a parsed function.
Real & _output_reporter
output containing reduction of vector into a scalar
ParsedVectorRealReductionReporter(const InputParameters ¶meters)
const Real _initial_reduction_value
static InputParameters validParams()
virtual void finalize() override
Finalize.
const std::vector< Real > & _vector_reporter_data
Vector being operated on.
The Reporter system is comprised of objects that can contain any number of data values.