19 params.
addRequiredParam<PostprocessorName>(
"postprocessor",
"The name of the postprocessor");
20 params.
addParam<
bool>(
"change_with_respect_to_initial",
22 "Compute change with respect to initial value instead of previous value");
24 "compute_relative_change",
false,
"Compute magnitude of relative change instead of change");
25 params.
addParam<
bool>(
"take_absolute_value",
false,
"Option to take absolute value of change");
27 params.
addClassDescription(
"Computes the change or relative change in a post-processor value " 28 "over a timestep or the entire transient");
35 _change_with_respect_to_initial(getParam<bool>(
"change_with_respect_to_initial")),
36 _compute_relative_change(getParam<bool>(
"compute_relative_change")),
37 _take_absolute_value(getParam<bool>(
"take_absolute_value")),
38 _pps_value(getPostprocessorValue(
"postprocessor")),
39 _pps_value_old(getPostprocessorValueOld(
"postprocessor")),
40 _pps_value_initial(declareRestartableData<
Real>(
"pps_value_initial")),
46 const PostprocessorName & pp_name = getParam<PostprocessorName>(
"postprocessor");
49 mooseError(
"When 'change_with_respect_to_initial' is specified to be true, 'execute_on' for " 50 "the dependent post-processor ('" +
51 pp_name +
"') must include 'initial'");
55 mooseError(
"When 'change_with_respect_to_initial' is specified to be true, 'execute_on' for " 56 "the ChangeOverTimePostprocessor ('" +
57 name() +
"') must include 'initial'");
94 change = (
_pps_value - base_value) / base_value;
99 _value = std::fabs(change);
static InputParameters validParams()
virtual Real getValue() const override
This will get called to actually grab the final value the postprocessor has calculated.
T & getUserObject(const std::string &name, unsigned int tid=0) const
Get the user object by its name.
Computes the change in a post-processor value, or the magnitude of its relative change, over a time step or over the entire transient.
registerMooseObject("MooseApp", ChangeOverTimePostprocessor)
virtual void execute() override
Execute method.
const bool _compute_relative_change
option to compute the magnitude of relative change instead of change
const PostprocessorValue & _pps_value_old
old post-processor value
This class is here to combine the Postprocessor interface and the base class Postprocessor object alo...
virtual const std::string & name() const
Get the name of the class.
const PostprocessorValue & _pps_value
current post-processor value
static InputParameters validParams()
bool contains(const std::string &value) const
Contains methods for seeing if a value is in the MultiMooseEnum.
int & _t_step
The number of the time step.
virtual void finalize() override
This is called after execute() and after threadJoin()! This is probably where you want to do MPI comm...
const bool _take_absolute_value
option to take the absolute value of the change
virtual void initialize() override
Called before execute() is ever called so that data can be cleared.
const bool _change_with_respect_to_initial
option to compute change with respect to initial value instead of previous time value ...
ChangeOverTimePostprocessor(const InputParameters ¶meters)
const ExecFlagEnum & _execute_enum
Execute settings for this object.
Real & _pps_value_initial
initial post-processor value
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
FEProblemBase & _fe_problem
Reference to the FEProblemBase for this user object.
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type.
Base class for user-specific data.
Real _value
This post-processor value.
const ExecFlagType EXEC_INITIAL