Distribution in which the probability density function is given as a table of values. More...
Public Member Functions | |
TypeName ("tabulatedDensity") | |
Runtime type information. More... | |
tabulatedDensity (const unitConversion &units, const dictionary &dict, const label sampleQ, randomGenerator &&rndGen) | |
Construct from a dictionary. More... | |
tabulatedDensity (const tabulatedDensity &d, const label sampleQ) | |
Construct copy. More... | |
virtual autoPtr< distribution > | clone (const label sampleQ) const |
Construct and return a clone. More... | |
virtual | ~tabulatedDensity () |
Destructor. More... | |
virtual scalar | sample () const |
Sample the distribution. More... | |
virtual scalar | min () const |
Return the minimum value. More... | |
virtual scalar | max () const |
Return the maximum value. More... | |
virtual scalar | mean () const |
Return the mean value. More... | |
virtual void | write (Ostream &os, const unitConversion &units) const |
Write to a stream. More... | |
virtual tmp< scalarField > | x (const label n) const |
Return coordinates to plot across the range of the distribution. More... | |
virtual tmp< scalarField > | PDF (const scalarField &x) const |
Return the distribution probability density function. More... | |
![]() | |
Type | sample () const |
Sample the distribution into components of a primitive type. More... | |
virtual tmp< scalarField > | sample (const label n) const |
Sample the distribution into a field. More... | |
![]() | |
TypeName ("distribution") | |
Runtime type information. More... | |
declareRunTimeSelectionTable (autoPtr, distribution, dictionary,(const unitConversion &units, const dictionary &dict, const label sampleQ, randomGenerator &&rndGen),(units, dict, sampleQ, std::move(rndGen))) | |
Declare runtime constructor selection table. More... | |
distribution (const word &name, const unitConversion &units, const dictionary &dict, const label sampleQ, randomGenerator &&rndGen) | |
Construct from dictionary. More... | |
distribution (const label Q, const label sampleQ, randomGenerator &&rndGen) | |
Construct from components. More... | |
distribution (const distribution &d, const label sampleQ) | |
Construct copy. More... | |
autoPtr< distribution > | clone () const |
Construct and return a clone. More... | |
virtual | ~distribution () |
Destructor. More... | |
template<class Type > | |
Type | sample () const |
Sample the distribution into components of a primitive type. More... | |
virtual void | writeState (Ostream &os) const |
Write the state to a stream. More... | |
Additional Inherited Members | |
![]() | |
static autoPtr< distribution > | New (const unitConversion &units, const dictionary &dict, const label sampleQ, randomGenerator &&rndGen, const bool report=true) |
Select from dictionary and a random generator. More... | |
static autoPtr< distribution > | New (const unitConversion &units, const dictionary &dict, const label sampleQ, const randomGenerator::seed &s, const bool global=false, const bool report=true) |
Select from a dictionary and a random generator seed and global flag. More... | |
static autoPtr< distribution > | New (autoPtr< distribution > &dPtr, const label sampleQ) |
Re-select with a different sample size exponent. More... | |
![]() | |
FOR_ALL_FIELD_TYPES (VIRTUAL_SAMPLE_TYPE) | |
![]() | |
virtual void | validateBounds (const dictionary &dict) const |
Validate that the bounds are monotonic. More... | |
virtual void | validatePositive (const dictionary &dict) const |
Validate that the lower bound is positive. More... | |
tmp< scalarField > | clipPDF (const scalarField &x, const tmp< scalarField > &pdf) const |
Clip the PDF values to zero outside the bounds. More... | |
label | q () const |
Return the effective distribution size exponent. More... | |
FOR_ALL_FIELD_TYPES (VIRTUAL_SAMPLE_TYPE) | |
![]() | |
const label | Q_ |
Distribution size exponent. More... | |
const label | sampleQ_ |
Sample size exponent. More... | |
randomGenerator | rndGen_ |
Random number generator. More... | |
Distribution in which the probability density function is given as a table of values.
{ type tabulatedDensity; Q 0; values ( (10e-6 0.0025) (12e-6 0.2795) (15e-6 2.3988) (19e-6 6.3888) (25e-6 10.3153) (31e-6 12.0030) (39e-6 10.8427) (50e-6 6.1333) (63e-6 3.4688) ); }
Definition at line 76 of file tabulatedDensity.H.
tabulatedDensity | ( | const unitConversion & | units, |
const dictionary & | dict, | ||
const label | sampleQ, | ||
randomGenerator && | rndGen | ||
) |
Construct from a dictionary.
Definition at line 45 of file tabulatedDensity.C.
References Foam::abort(), dict, Foam::FatalIOError, FatalIOErrorInFunction, Foam::first(), forAll, Foam::integerPow(), unintegrable::integrate(), UList< T >::last(), distribution::q(), List< T >::resize(), Foam::second(), List< T >::size(), Foam::units(), distribution::validateBounds(), and distribution::validatePositive().
Referenced by tabulatedDensity::clone().
tabulatedDensity | ( | const tabulatedDensity & | d, |
const label | sampleQ | ||
) |
Construct copy.
Definition at line 114 of file tabulatedDensity.C.
References Foam::integerPow(), unintegrable::integrate(), UList< T >::last(), and distribution::q().
|
virtual |
Destructor.
Definition at line 141 of file tabulatedDensity.C.
TypeName | ( | "tabulatedDensity" | ) |
Runtime type information.
|
inlinevirtual |
Construct and return a clone.
Implements distribution.
Definition at line 115 of file tabulatedDensity.H.
References tabulatedDensity::tabulatedDensity().
|
virtual |
Sample the distribution.
Implements distribution.
Definition at line 147 of file tabulatedDensity.C.
References unintegrable::sample().
|
virtual |
Return the minimum value.
Implements distribution.
Definition at line 153 of file tabulatedDensity.C.
|
virtual |
Return the maximum value.
Implements distribution.
Definition at line 159 of file tabulatedDensity.C.
|
virtual |
Return the mean value.
Implements distribution.
Definition at line 165 of file tabulatedDensity.C.
References unintegrable::integrateX().
|
virtual |
Write to a stream.
Reimplemented from distribution.
Definition at line 171 of file tabulatedDensity.C.
References UList< T >::first(), forAll, Foam::integerPow(), unintegrable::integrate(), Foam::units(), Foam::vtkWriteOps::write(), and Foam::writeEntry().
|
virtual |
Return coordinates to plot across the range of the distribution.
Reimplemented from distribution.
Definition at line 196 of file tabulatedDensity.C.
References Foam::max(), Foam::min(), tmp< T >::ref(), and List< T >::size().
|
virtual |
Return the distribution probability density function.
Implements distribution.
Definition at line 219 of file tabulatedDensity.C.
References tmp< T >::ref(), and List< T >::size().