19 params.
addRequiredParam<std::vector<PostprocessorName>>(
"pp_names",
"List of post-processors");
21 "pp_coefs",
"List of linear combination coefficients for each post-processor");
22 params.
addParam<Real>(
"b", 0,
"Additional value to add to sum");
24 "Computes a linear combination between an arbitrary number of post-processors");
30 _n_pp(coupledPostprocessors(
"pp_names")),
31 _pp_coefs(getParam<
std::vector<Real>>(
"pp_coefs")),
32 _b_value(getParam<Real>(
"b"))
35 mooseError(
"The list parameters 'pp_names' and 'pp_coefs' must have the same length");
38 for (
unsigned int i = 0; i <
_n_pp; i++)
56 for (
unsigned int i = 0; i <
_n_pp; i++)
59 return linear_combination;
registerMooseObject("MooseApp", LinearCombinationPostprocessor)
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
Real PostprocessorValue
various MOOSE typedefs
This class is here to combine the Postprocessor interface and the base class Postprocessor object alo...
static InputParameters validParams()
Computes a linear combination between an arbitrary number of post-processors.
LinearCombinationPostprocessor(const InputParameters ¶meters)
std::vector< const PostprocessorValue * > _pp_values
List of post-processor values.
virtual void execute() override
Execute method.
virtual void initialize() override
Called before execute() is ever called so that data can be cleared.
const unsigned int _n_pp
Number of post-processors in linear combination.
const Real _b_value
Additional value to add to sum.
virtual PostprocessorValue getValue() const override
This will get called to actually grab the final value the postprocessor has calculated.
static InputParameters validParams()
const std::vector< Real > & _pp_coefs
List of linear combination coefficients for each post-processor value.
const PostprocessorValue & getPostprocessorValue(const std::string ¶m_name, const unsigned int index=0) const
doco-normal-methods-begin Retrieve the value of a Postprocessor or one of it's old or older values