12 #include "libmesh/point.h" 23 "min", 0.0,
"Lower bound of uniformly distributed randomly generated values");
25 "max", 1.0,
"Upper bound of uniformly distributed randomly generated values");
27 "distribution",
"Name of distribution defining distribution of randomly generated values");
29 params.
addClassDescription(
"Initialize a variable with randomly generated numbers following " 30 "either a uniform distribution or a user-defined distribution");
37 _min(getParam<
Real>(
"min")),
38 _max(getParam<
Real>(
"max")),
39 _distribution(nullptr)
48 paramError(
"distribution",
"Cannot use together with 'min' or 'max' parameter");
registerMooseObject("MooseApp", RandomIC)
Real generateRandom()
Generate a uniformly distributed random number on the interval from 0 to 1.
const Real _max
The upper bound of the random number range.
static InputParameters validParams()
RandomIC(const InputParameters ¶meters)
Constructor.
virtual Real value(const Point &p) override
The value of the variable at a point.
Interface for objects that need to use distributions.
RandomIC just returns a Random value.
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 ...
Distribution const * _distribution
Distribution object optionally used to define distribution of random numbers.
const Real _min
The lower bound of the random number range.
const Distribution & getDistributionByName(const DistributionName &name) const
Get a distribution with a given name.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static InputParameters validParams()
const InputParameters & parameters() const
Get the parameters of the object.
virtual Real quantile(const Real &y) const =0
Compute the inverse CDF (quantile function) value for given variable value y.
static InputParameters validParams()
Base class for randomly generated initial conditions.