18 params.
addClassDescription(
"Reporter which accumulates the value of a inputted reporter value " 19 "over time into a vector reporter value of the same type.");
20 params.
addRequiredParam<std::vector<ReporterName>>(
"reporters",
"The reporters to accumulate.");
36 for (
const auto & rname :
getParam<std::vector<ReporterName>>(
"reporters"))
39 paramError(
"reporters",
"Reporter ", rname,
" does not exist.");
41 if (!declareAccumulateHelper<int>(rname) && !declareAccumulateHelper<Real>(rname) &&
42 !declareAccumulateHelper<dof_id_type>(rname) &&
43 !declareAccumulateHelper<std::string>(rname) &&
45 !declareAccumulateHelper<std::vector<Real>>(rname) &&
47 !declareAccumulateHelper<std::vector<dof_id_type>>(rname))
51 " is of unsupported type ",
60 unsigned int ind =
static_cast<unsigned int>(
_t_step);
A MultiMooseEnum object to hold "execute_on" flags.
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 T & getParam(const std::string &name) const
Retrieve a parameter for the object.
virtual void declareLateValues() override
Method that can be overriden to declare "late" Reporter values.
Reporter object that has a single execution of the "execute" method for for each execute flag...
virtual std::string type() const =0
Return the type of the data stored.
static InputParameters validParams()
static InputParameters validParams()
const ExecFlagType EXEC_TIMESTEP_END
const ReporterData & getReporterData() const
Provides const access the ReporterData object.
int & _t_step
The number of the time step.
virtual void execute() override
Execute method.
FEProblemBase & _fe_problem
Reference to the FEProblemBase for this user object.
bool hasReporterValue(const ReporterName &reporter_name) const
Return True if a Reporter value with the given type and name have been created.
AccumulateReporter(const InputParameters ¶meters)
std::vector< std::unique_ptr< AccumulatedValueBase > > _accumulated_values
Vector of accumulated value objects.
registerMooseObject("MooseApp", AccumulateReporter)
const ReporterContextBase & getReporterContextBase(const ReporterName &reporter_name) const
bool declareAccumulateHelper(const ReporterName &rname)
Helper for declaring an accumulative reporter value This will fill in _accumulated_values if the repo...
const ExecFlagType EXEC_INITIAL
This is a helper class for managing the storage of declared Reporter object values.