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(
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'.");
GenericReal< is_ad > evaluate(SymFunctionPtr &, const std::string &object_name="")
Evaluate FParser object and check EvalError.
Reporter performing a reduction on a vector using a parsed function.
KOKKOS_INLINE_FUNCTION const T * find(const T &target, const T *const begin, const T *const end)
Find a value in an array.
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
Real & _output_reporter
output containing reduction of vector into a scalar
SymFunctionPtr _func_F
function parser object
const Real _initial_reduction_value
ParsedVectorRealReductionReporter(const InputParameters ¶meters)
const std::vector< Real > & _vector_reporter_data
Vector being operated on.
static InputParameters validParams()
static InputParameters validParams()
registerMooseObject("MooseApp", ParsedVectorRealReductionReporter)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual void finalize() override
Finalize.
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
Reporter containing operation between vectors from another Reporter.
auto index_range(const T &sizable)
The Reporter system is comprised of objects that can contain any number of data values.