34 namespace distributionModels
50 minValue_(distributionModelDict_.template lookup<scalar>(
"minValue")),
51 maxValue_(distributionModelDict_.template lookup<scalar>(
"maxValue")),
52 expectation_(distributionModelDict_.template lookup<scalar>(
"expectation")),
53 variance_(distributionModelDict_.template lookup<scalar>(
"variance")),
64 minValue_(p.minValue_),
65 maxValue_(p.maxValue_),
66 expectation_(p.expectation_),
67 variance_(p.variance_),
83 scalar a =
erf((minValue_ - expectation_)/variance_);
84 scalar
b =
erf((maxValue_ - expectation_)/variance_);
87 scalar
x =
erfInv(y*(b - a) + a)*variance_ + expectation_;
92 x =
min(
max(x, minValue_), maxValue_);
119 scalar
h =
log(1.0 - y*y)/a_;
A normal distribution model.
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
virtual scalar sample() const
Sample the distributionModel.
dimensionedScalar log(const dimensionedScalar &ds)
Random & rndGen_
Reference to the random number generator.
virtual scalar minValue() const
Return the minimum value.
A list of keyword definitions, which are a keyword followed by any number of values (e...
virtual scalar erfInv(const scalar y) const
dimensionedScalar sqrt(const dimensionedScalar &ds)
const dimensionedScalar b
Wien displacement law constant: default SI units: [m K].
label k
Boltzmann constant.
const dimensionedScalar h
Planck constant.
Macros for easy insertion into run-time selection tables.
virtual scalar maxValue() const
Return the maximum value.
Type sample01()
Advance the state and return a sample of a given type from a.
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
virtual scalar meanValue() const
Return the mean value.
virtual ~normal()
Destructor.
normal(const dictionary &dict, Random &rndGen)
Construct from components.
defineTypeNameAndDebug(exponential, 0)
dimensionedScalar erf(const dimensionedScalar &ds)
A library of runtime-selectable distribution models.
addToRunTimeSelectionTable(distributionModel, exponential, dictionary)