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) &&
44 !declareAccumulateHelper<std::vector<int>>(rname) &&
46 !declareAccumulateHelper<std::vector<std::string>>(rname) &&
51 " is of unsupported type ",
60 unsigned int ind =
static_cast<unsigned int>(
_t_step);
registerMooseObject("MooseApp", AccumulateReporter)
const ExecFlagType EXEC_TIMESTEP_END
const ExecFlagType EXEC_INITIAL
virtual void declareLateValues() override
Method that can be overriden to declare "late" Reporter values.
AccumulateReporter(const InputParameters ¶meters)
bool declareAccumulateHelper(const ReporterName &rname)
Helper for declaring an accumulative reporter value This will fill in _accumulated_values if the repo...
virtual void execute() override
Execute method.
std::vector< std::unique_ptr< AccumulatedValueBase > > _accumulated_values
Vector of accumulated value objects.
static InputParameters validParams()
A MultiMooseEnum object to hold "execute_on" flags.
const ReporterData & getReporterData() const
Provides const access the ReporterData object.
Reporter object that has a single execution of the "execute" method for each execute flag.
static InputParameters validParams()
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 ...
virtual std::string type() const =0
Return the type of the data stored.
This is a helper class for managing the storage of declared Reporter object values.
const ReporterContextBase & getReporterContextBase(const ReporterName &reporter_name) const
bool hasReporterValue(const ReporterName &reporter_name) const
Return True if a Reporter value with the given type and name have been created.
int & _t_step
The number of the time step.
FEProblemBase & _fe_problem
Reference to the FEProblemBase for this user object.