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)
Interface for objects that need to use distributions.
static InputParameters validParams()
const Distribution & getDistributionByName(const DistributionName &name) const
Get a distribution with a given name.
virtual Real quantile(const Real &y) const =0
Compute the inverse CDF (quantile function) value for given variable value y.
const InputParameters & parameters() const
Get the parameters of the object.
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 ...
Base class for randomly generated initial conditions.
static InputParameters validParams()
Real generateRandom()
Generate a uniformly distributed random number on the interval from 0 to 1.
RandomIC just returns a Random value.
const Real _max
The upper bound of the random number range.
static InputParameters validParams()
Distribution const * _distribution
Distribution object optionally used to define distribution of random numbers.
RandomIC(const InputParameters ¶meters)
Constructor.
virtual Real value(const Point &p) override
The value of the variable at a point.
const Real _min
The lower bound of the random number range.