36namespace distributionModels
52 lambda_(distributionModelDict_.get<scalar>(
"lambda"))
57 <<
"Rate parameter cannot be equal to or less than zero:" <<
nl
58 <<
" lambda = " << lambda_
77 const scalar u = rndGen_.sample01<scalar>();
78 const scalar qMin =
exp(-lambda_*minValue_);
79 const scalar qMax =
exp(-lambda_*maxValue_);
80 return -(scalar(1)/lambda_)*
log(qMin + u*(qMax - qMin));
86 return scalar(1)/lambda_;
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
A library of runtime-selectable doubly-truncated probability distribution models. Returns random samp...
virtual void check() const
Check that the distribution model is valid.
Particle-size distribution model wherein random samples are drawn from the doubly-truncated exponenti...
virtual scalar meanValue() const
Return the theoretical mean of the distribution.
virtual scalar sample() const
Sample the distribution.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
dimensionedScalar exp(const dimensionedScalar &ds)
dimensionedScalar log(const dimensionedScalar &ds)
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a)