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.");
25 "Value to intialize the reduction with.");
29 params.
set<std::vector<std::string>>(
"vector_reporter_symbols") = {
"reduction_value",
40 _initial_reduction_value(getParam<Real>(
"initial_reduction_value")),
41 _vec_of_vec_name(getParam<
ReporterName>(
"vector_of_vector_reporter_name")),
44 _reporter_data(getReporterValueByName<
std::vector<
std::vector<Real>>>(
45 getParam<
ReporterName>(
"vector_of_vector_reporter_name")))
48 std::string function = getParam<std::string>(
"expression");
50 if (function.find(
"reduction_value") == std::string::npos ||
51 function.find(
"indexed_value") == std::string::npos)
54 "Parsed function must contain the two symbols 'reduction_value' and 'indexed_value'.");
61 std::size_t nrows = 0;
67 if (reporter_vector.size() != nrows)
68 mooseError(
"Every vector in 'vector_of_vector_reporter_name=",
70 "' must be the same size.",
71 "\nFirst Vector size = ",
73 "\nCurrent Vector size = ",
74 reporter_vector.size());
79 for (
const auto i_row : make_range(nrows))
82 for (
const auto j_col : make_range(ncols))
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
registerMooseObject("MooseApp", ParsedVectorVectorRealReductionReporter)
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 containing row sum of a vector of vectors from another Reporter.
const std::vector< std::vector< Real > > & _reporter_data
Vector being operated on.
std::vector< Real > & _output_reporter
output containing reduction of vector of vector into a vector
static InputParameters validParams()
const Real _initial_reduction_value
ParsedVectorVectorRealReductionReporter(const InputParameters ¶meters)
const ReporterName _vec_of_vec_name
virtual void finalize() override
Finalize.
The Reporter system is comprised of objects that can contain any number of data values.