44 <<
type() <<
": The maximum value is smaller than the minimum "
45 <<
"value:" <<
nl <<
" max = " <<
max() <<
", min = "
56 <<
type() <<
": The minimum value must be greater than "
57 <<
"zero." <<
nl <<
" min = " <<
min()
85 Q_(
dict.lookup<scalar>(
"Q")),
89 if (!
dict.lookupOrDefault<
bool>(
"allowNegativeQ",
false) &&
Q_ < 0)
92 <<
name <<
": Size exponent cannot be negative" <<
nl
99 <<
name <<
": Sampling size exponent cannot be negative" <<
nl
142 rndGen_.start(restart);
149 return integralPDFxPow(
x, 0);
168 const scalar x0 =
min(), x1 =
max(), d = 0.1*(x1 - x0);
174 result[1] = x0*(1 -
sign(x0)*small);
175 result[2] = x0*(1 +
sign(x0)*small);
177 for (
label i = 3; i <
n - 3; ++ i)
179 const scalar
f = scalar(i - 2)/(
n - 5);
181 result[i] = (1 -
f)*x0 +
f*x1;
184 result[
n - 3] = x1*(1 -
sign(x1)*small);
185 result[
n - 2] = x1*(1 +
sign(x1)*small);
186 result[
n - 1] = x1 + d;
197 const word& entryName,
201 const bool writeState
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Base class for statistical distributions.
virtual scalar max() const =0
Return the maximum value.
label sampleQ() const
Access the sample size exponent.
virtual void writeState(Ostream &os) const
Write the state to a stream.
virtual void validatePositive(const dictionary &dict) const
Validate that the lower bound is positive.
tmp< scalarField > clipPDF(const scalarField &x, const tmp< scalarField > &pdf) const
Clip the PDF values to zero outside the bounds.
const label Q_
Distribution size exponent.
virtual ~distribution()
Destructor.
const label sampleQ_
Sample size exponent.
distribution(const word &name, const unitConversion &units, const dictionary &dict, const label sampleQ, randomGenerator &&rndGen)
Construct from dictionary.
virtual tmp< scalarField > CDF(const scalarField &x) const
Return the cumulative density function at the given coordinates.
virtual void validateBounds(const dictionary &dict) const
Validate that the bounds are monotonic.
virtual void write(Ostream &os, const unitConversion &units) const
Write to a stream.
virtual scalar min() const =0
Return the minimum value.
void start(const bool repeat) const
Start a sequence of samples. Either a new sequence, or a.
virtual tmp< scalarField > plotX(const label n) const
Return coordinates to plot across the range of the distribution.
A class for managing temporary objects.
T & ref() const
Return non-const reference or generate a fatal error.
Unit conversion structure. Contains the associated dimensions and the multiplier with which to conver...
A class for handling words, derived from string.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
void write(std::ostream &os, const bool binary, List< floatScalar > &fField)
Write floats ascii or binary.
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
dimensionedScalar pos0(const dimensionedScalar &ds)
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
dimensionedScalar sign(const dimensionedScalar &ds)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
errorManip< error > abort(error &err)
Ostream & incrIndent(Ostream &os)
Increment the indent level.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
const HashTable< unitConversion > & units()
Get the table of unit conversions.
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
defineTypeNameAndDebug(combustionModel, 0)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
Ostream & writeKeyword(Foam::Ostream &os, const keyType &kw)
Write the keyword to the Ostream with the current level of indentation.
Ostream & indent(Ostream &os)
Indent stream.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
randomGenerator rndGen(653213)