15 #include "libmesh/quadrature.h" 28 "Compute a histogram of volume fractions binned according to variable values.");
29 params.
addParam<
unsigned int>(
"bin_number", 50,
"Number of histogram bins");
30 params.
addCoupledVar(
"variable",
"Variable to bin the volume of");
38 _nbins(getParam<unsigned
int>(
"bin_number")),
39 _min_value(getParam<
Real>(
"min_value")),
40 _max_value(getParam<
Real>(
"max_value")),
41 _deltaV((_max_value - _min_value) / _nbins),
42 _value(coupledValue(
"variable")),
43 _bin_center(declareVector(coupledName(
"variable"))),
44 _volume(declareVector(
"n"))
47 mooseError(
"VariableValueVolumeHistogram works on exactly one coupled variable");
51 for (
unsigned i = 0; i <
_nbins; ++i)
72 if (bin >= 0 && static_cast<unsigned int>(bin) <
_nbins)
87 mooseAssert(uo._volume.size() ==
_volume.size(),
88 "Inconsistent volume vector lengths across threads.");
90 for (
unsigned int i = 0; i <
_volume.size(); ++i)
const Real _deltaV
bin width
const MooseArray< Real > & _coord
VariableValueVolumeHistogram(const InputParameters ¶meters)
virtual void threadJoin(const UserObject &y) override
Must override.
void gatherSum(T &value)
Gather the parallel sum of the variable passed in.
static InputParameters validParams()
virtual void finalize() override
Finalize.
registerMooseObject("MooseApp", VariableValueVolumeHistogram)
VectorPostprocessorValue & _volume
aggregated volume for the given bin
unsigned int coupledComponents(const std::string &var_name) const
Number of coupled components.
unsigned int _qp
current quadrature point - used in computeVolume()
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const QBase *const & _qrule
virtual Real computeVolume()
compute the volume contribution at the current quadrature point
const MooseArray< Real > & _JxW
registerMooseObjectRenamed("MooseApp", VolumeHistogram, "06/30/2022 24:00", VariableValueVolumeHistogram)
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 VariableValue & _value
coupled variable that is being binned
Compute a histogram of volume fractions binned according to variable values.
virtual void execute() override
Execute method.
virtual void initialize() override
Called before execute() is ever called so that data can be cleared.
const unsigned int _nbins
number of histogram bins
const Real _min_value
minimum variable value
void ErrorVector unsigned int
Base class for user-specific data.