Go to the documentation of this file.
15 #include "libmesh/quadrature.h"
23 params.
addParam<
unsigned int>(
"bin_number", 50,
"Number of histogram bins");
24 params.
addCoupledVar(
"variable",
"Variables to average radially");
26 params.
addParam<Point>(
"origin", Point(),
"Origin of the cylinder");
28 "empty_bin_value", 0.0,
"Value to assign to bins into which no datapoints fall");
34 _nbins(getParam<unsigned int>(
"bin_number")),
35 _radius(getParam<Real>(
"radius")),
36 _origin(getParam<Point>(
"origin")),
37 _deltaR(_radius / _nbins),
38 _nvals(coupledComponents(
"variable")),
40 _empty_bin_value(getParam<Real>(
"empty_bin_value")),
41 _bin_center(declareVector(
"radius")),
46 mooseError(
"SpatialAverageBase works on exactly one coupled variable");
68 vec_ptr->assign(
_nbins, 0.0);
84 if (bin >= 0 && bin < static_cast<int>(
_nbins))
void gatherSum(T &value)
Gather the parallel sum of the variable passed in.
SpatialAverageBase(const InputParameters ¶meters)
const Real _empty_bin_value
value to assign to empty bins
void mooseError(Args &&... args) const
const unsigned int _nbins
number of histogram bins
VectorPostprocessorValue & declareVector(const std::string &vector_name)
Register a new vector to fill up.
Base clase for computing spatial average of a variable over simple spatial regions of the computation...
virtual void initialize() override
Called before execute() is ever called so that data can be cleared.
VectorPostprocessorValue & _bin_center
value mid point of the bin
const Real _deltaR
bin width
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
virtual void finalize() override
Finalize.
std::vector< unsigned int > _counts
sample count per bin
defineLegacyParams(SpatialAverageBase)
virtual void threadJoin(const UserObject &y) override
Must override.
std::vector< VectorPostprocessorValue * > _average
aggregated global average vectors
Base class for user-specific data.
virtual const VariableValue & coupledValue(const std::string &var_name, unsigned int comp=0)
Returns value of a coupled variable.
unsigned int _qp
current quadrature point - used in computeVolume()
const unsigned int _nvals
number of coupled variables
const QBase *const & _qrule
unsigned int coupledComponents(const std::string &var_name)
Number of coupled components.
std::vector< const VariableValue * > _values
coupled variable that is being binned
static InputParameters validParams()
virtual void execute() override
Execute method.
virtual const std::string & name() const
Get the name of the object.
virtual Real computeDistance()=0
compute the distance of the current quadarature point for binning
static InputParameters validParams()