21 MooseEnum(
"max=0 min=1 sum=2 average=3",
"sum"),
22 "Type of reduction operation. Options are max, min, sum, and average.");
25 "Relevant when 'value_type' is sum or average. When computing an average, these are the " 26 "weights for a weighted average and when computing a sum, these weight scale each variable " 27 "component in the summation.");
28 params.
addClassDescription(
"Takes an array variable and performs a reduction operation on it " 29 "(max, min, sum, average) and stores as a standard variable.");
35 _array_variable(coupledArrayValue(
"array_variable")),
36 _value_type(getParam<
MooseEnum>(
"value_type")),
37 _weights(isParamValid(
"weights")
45 "The number of values provided is " + std::to_string(
_weights.size()) +
46 " but the number of components for the variable provided by 'array_variable' is " +
47 std::to_string(array_comps));
49 paramError(
"weights",
"Is only meant to be be used when 'value_type' is average or sum");
const RealEigenVector _weights
values specified by the weights parameter or 1 otherwise
Real computeValue() override
Compute and return the value of the aux variable.
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 ...
unsigned int count() const
Get the number of components Note: For standard and vector variables, the number is one...
registerMooseObject("MooseApp", ArrayVarReductionAux)
static InputParameters validParams()
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
const MooseEnum _value_type
The type of reduction operation performed on the array variable.
const ArrayVariableValue & _array_variable
the array variable value we will perform the reduction on
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
ArrayVarReductionAux(const InputParameters ¶meters)
ArrayMooseVariable * getArrayVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled array variable.
unsigned int _qp
Quadrature point index.
static InputParameters validParams()
Eigen::Matrix< Real, Eigen::Dynamic, 1 > RealEigenVector
Base class for creating new auxiliary kernels and auxiliary boundary conditions.
bool isParamValid(const std::string &name) const
Test if the supplied parameter is valid.