19 "Use a parsed function to iterate through a vector and reduce it to a scalar.");
25 params.
set<std::vector<std::string>>(
"reporter_symbols") = {
"reduction_value",
"indexed_value"};
37 _initial_value(getParam<
Real>(
"initial_value")),
43 std::string
function = getParam<std::string>(
"expression");
45 if (
function.find(
"reduction_value") == std::string::npos ||
46 function.find(
"indexed_value") == std::string::npos)
49 "Parsed function must contain the two symbols 'reduction_value' and 'indexed_value'.");
GenericReal< is_ad > evaluate(SymFunctionPtr &, const std::string &object_name="")
Reporter performing a reduction on a vector using a parsed function.
const ReporterMode REPORTER_MODE_ROOT
Real & _output_reporter
output containing reduction of vector into a scalar
const ExecFlagType EXEC_TIMESTEP_END
const std::vector< Real > & _reporter_data
Vector being operated on.
SymFunctionPtr _func_F
function parser object
ParsedVectorRealReductionReporter(const InputParameters ¶meters)
const Real _initial_value
static InputParameters validParams()
registerMooseObject("OptimizationApp", ParsedVectorRealReductionReporter)
static InputParameters validParams()
void paramError(const std::string ¶m, Args... args) const
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual void finalize() override
std::vector< GenericReal< is_ad > > _func_params
const bool _use_t
whether time is part of the parsed expression
Reporter containing operation between vectors from another Reporter.
auto index_range(const T &sizable)