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>();
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...
const dictionary distributionModelDict_
Coefficients dictionary.
virtual void check() const
Check that the distribution model is valid.
Random & rndGen_
Reference to the random number generator.
scalar minValue_
Minimum of the distribution.
scalar maxValue_
Maximum of the distribution.
distributionModel(const word &name, const dictionary &dict, Random &rndGen)
Construct from dictionary.
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.
exponential(const dictionary &dict, Random &rndGen)
Construct from components.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
A namespace for various probability distribution model implementations.
dimensionedScalar exp(const dimensionedScalar &ds)
dimensionedScalar log(const dimensionedScalar &ds)
const word GlobalIOList< Tuple2< scalar, vector > >::typeName("scalarVectorTable")
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a).