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());
GenericReal< is_ad > evaluate(SymFunctionPtr &, const std::string &object_name="")
Evaluate FParser object and check EvalError.
const std::vector< std::vector< Real > > & _reporter_data
Vector being operated on.
KOKKOS_INLINE_FUNCTION const T * find(const T &target, const T *const begin, const T *const end)
Find a value in an array.
registerMooseObject("MooseApp", ParsedVectorVectorRealReductionReporter)
const ReporterName _vec_of_vec_name
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 ReporterMode REPORTER_MODE_ROOT
const Real _initial_reduction_value
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()
static InputParameters validParams()
virtual void finalize() override
Finalize.
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
Array to stage the parameters passed to the functions when calling Eval.
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
Emits an error prefixed with object name and type and optionally a file path to the top-level block p...
Reporter containing operation between vectors from another Reporter.
The Reporter system is comprised of objects that can contain any number of data values.