15#include "libmesh/quadrature.h"
21 params.
addParam<
unsigned int>(
"bin_number", 50,
"Number of histogram bins");
22 params.
addCoupledVar(
"variable",
"Variables to average radially");
24 params.
addParam<Point>(
"origin", Point(),
"Origin of the cylinder");
26 "empty_bin_value", 0.0,
"Value to assign to bins into which no datapoints fall");
32 _nbins(getParam<unsigned
int>(
"bin_number")),
33 _radius(getParam<Real>(
"radius")),
34 _origin(getParam<Point>(
"origin")),
35 _deltaR(_radius / _nbins),
36 _nvals(coupledComponents(
"variable")),
37 _values(coupledValues(
"variable")),
38 _empty_bin_value(getParam<Real>(
"empty_bin_value")),
39 _bin_center(declareVector(
"radius")),
44 mooseError(
"SpatialAverageBase works on exactly one coupled variable");
63 vec_ptr->assign(
_nbins, 0.0);
79 if (bin >= 0 && bin <
static_cast<int>(
_nbins))
114 (*
_average[j])[i] += (*uo._average[j])[i];
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
void ErrorVector unsigned int
VariableName coupledName(const std::string &var_name, unsigned int comp=0) const
Names of the variable in the Coupleable interface.
unsigned int coupledComponents(const std::string &var_name) const
Number of coupled components.
const QBase *const & _qrule
static InputParameters validParams()
Base clase for computing spatial average of a variable over simple spatial regions of the computation...
static InputParameters validParams()
const std::vector< const VariableValue * > _values
coupled variable that is being binned
const unsigned int _nvals
number of coupled variables
std::vector< VectorPostprocessorValue * > _average
aggregated global average vectors
virtual void threadJoin(const UserObject &y) override
Must override.
std::vector< unsigned int > _counts
sample count per bin
const Real _deltaR
bin width
virtual Real computeDistance()=0
compute the distance of the current quadarature point for binning
const unsigned int _nbins
number of histogram bins
unsigned int _qp
current quadrature point - used in computeVolume()
SpatialAverageBase(const InputParameters ¶meters)
virtual void initialize() override
Called before execute() is ever called so that data can be cleared.
const Real _empty_bin_value
value to assign to empty bins
VectorPostprocessorValue & _bin_center
value mid point of the bin
virtual void finalize() override
Finalize.
virtual void execute() override
Execute method.
void gatherSum(T &value)
Gather the parallel sum of the variable passed in.
Base class for user-specific data.
VectorPostprocessorValue & declareVector(const std::string &vector_name)
Register a new vector to fill up.