19 params.
addClassDescription(
"Weighted average of variables using other variables as weights");
28 :
AuxKernel(parameters), _n_values(coupledComponents(
"values"))
32 mooseError(
name(),
": The number of weights must equal the number of values");
35 for (
unsigned int i = 0; i <
_n_values; i++)
45 Real weight_total = 0;
46 for (
unsigned int i = 0; i <
_n_values; i++)
49 Real weighted_sum = 0;
50 for (
unsigned int i = 0; i <
_n_values; i++)
53 return weighted_sum / weight_total;
const unsigned int _n_values
virtual const std::string & name() const
static InputParameters validParams()
virtual const VariableValue & coupledValue(const std::string &var_name, unsigned int comp=0) const
virtual Real computeValue()
std::vector< const VariableValue * > _weights
unsigned int coupledComponents(const std::string &var_name) const
registerMooseObject("ThermalHydraulicsApp", WeightedAverageAux)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::vector< const VariableValue * > _values
Weighted average of an aux variable using another aux variable as the weights
void mooseError(Args &&... args) const
static InputParameters validParams()
WeightedAverageAux(const InputParameters ¶meters)