19 params.
addClassDescription(
"Use a parsed function to iterate through a rows of a vector of " 20 "vector and reduce it to a vector.");
22 "Reporter name with vector of vectors to reduce.");
27 params.
set<std::vector<std::string>>(
"reporter_symbols") = {
"reduction_value",
"indexed_value"};
39 _initial_value(getParam<
Real>(
"initial_value")),
40 _vec_of_vec_name(getParam<
ReporterName>(
"reporter_name")),
43 _reporter_data(getReporterValueByName<
std::vector<
std::vector<
Real>>>(
47 std::string
function = getParam<std::string>(
"expression");
49 if (
function.find(
"reduction_value") == std::string::npos ||
50 function.find(
"indexed_value") == std::string::npos)
53 "Parsed function must contain the two symbols 'reduction_value' and 'indexed_value'.");
60 std::size_t nrows = 0;
66 if (reporter_vector.size() != nrows)
69 "' must be the same size.",
70 "\nFirst Vector size = ",
72 "\nCurrent Vector size = ",
73 reporter_vector.size());
GenericReal< is_ad > evaluate(SymFunctionPtr &, const std::string &object_name="")
const std::vector< std::vector< Real > > & _reporter_data
Vector being operated on.
const ReporterName _vec_of_vec_name
const ReporterMode REPORTER_MODE_ROOT
const Real _initial_value
const ExecFlagType EXEC_TIMESTEP_END
SymFunctionPtr _func_F
function parser object
ParsedVectorVectorRealReductionReporter(const InputParameters ¶meters)
std::vector< Real > & _output_reporter
output containing reduction of vector of vector into a vector
static InputParameters validParams()
void paramError(const std::string ¶m, Args... args) const
static InputParameters validParams()
registerMooseObject("OptimizationApp", ParsedVectorVectorRealReductionReporter)
virtual void finalize() override
Reporter containing row sum of a vector of vectors from another Reporter.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::vector< GenericReal< is_ad > > _func_params
const bool _use_t
whether time is part of the parsed expression
IntRange< T > make_range(T beg, T end)
void mooseError(Args &&... args) const
Reporter containing operation between vectors from another Reporter.