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];
virtual Real computeDistance()=0
compute the distance of the current quadarature point for binning
static InputParameters validParams()
const unsigned int _nvals
number of coupled variables
virtual void threadJoin(const UserObject &y) override
Must override.
std::vector< unsigned int > _counts
sample count per bin
VariableName coupledName(const std::string &var_name, unsigned int comp=0) const
Names of the variable in the Coupleable interface.
std::vector< VectorPostprocessorValue * > _average
aggregated global average vectors
SpatialAverageBase(const InputParameters ¶meters)
const Real _deltaR
bin width
void gatherSum(T &value)
Gather the parallel sum of the variable passed in.
virtual void finalize() override
Finalize.
unsigned int _qp
current quadrature point - used in computeVolume()
VectorPostprocessorValue & declareVector(const std::string &vector_name)
Register a new vector to fill up.
unsigned int coupledComponents(const std::string &var_name) const
Number of coupled components.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const QBase *const & _qrule
const unsigned int _nbins
number of histogram bins
const std::vector< const VariableValue * > _values
coupled variable that is being binned
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type.
static InputParameters validParams()
VectorPostprocessorValue & _bin_center
value mid point of the bin
const Real _empty_bin_value
value to assign to empty bins
void ErrorVector unsigned int
Base class for user-specific data.
virtual void initialize() override
Called before execute() is ever called so that data can be cleared.
Base clase for computing spatial average of a variable over simple spatial regions of the computation...
virtual void execute() override
Execute method.