uniform Class Reference

Distribution in which all values between a specified minimum and maximum have the same probability. More...

Inheritance diagram for uniform:
Collaboration diagram for uniform:

Public Member Functions

 TypeName ("uniform")
 Runtime type information. More...
 
 uniform (const unitConversion &units, const dictionary &dict, const label sampleQ, randomGenerator &&rndGen)
 Construct from a dictionary. More...
 
 uniform (const uniform &d, const label sampleQ)
 Construct copy. More...
 
virtual autoPtr< distributionclone (const label sampleQ) const
 Construct and return a clone. More...
 
virtual ~uniform ()
 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< scalarFieldPDF (const scalarField &x) const
 Return the distribution probability density function. More...
 
- Public Member Functions inherited from FieldDistribution< distribution, uniform >
Type sample () const
 Sample the distribution into components of a primitive type. More...
 
virtual tmp< scalarFieldsample (const label n) const
 Sample the distribution into a field. More...
 
- Public Member Functions inherited from distribution
 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< distributionclone () 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...
 
virtual tmp< scalarFieldx (const label n) const
 Return coordinates to plot across the range of the distribution. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from distribution
static autoPtr< distributionNew (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< distributionNew (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< distributionNew (autoPtr< distribution > &dPtr, const label sampleQ)
 Re-select with a different sample size exponent. More...
 
- Protected Member Functions inherited from FieldDistribution< distribution, uniform >
 FOR_ALL_FIELD_TYPES (VIRTUAL_SAMPLE_TYPE)
 
- Protected Member Functions inherited from distribution
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< scalarFieldclipPDF (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)
 
- Protected Attributes inherited from distribution
const label Q_
 Distribution size exponent. More...
 
const label sampleQ_
 Sample size exponent. More...
 
randomGenerator rndGen_
 Random number generator. More...
 

Detailed Description

Distribution in which all values between a specified minimum and maximum have the same probability.

Usage
Example usage:
{
    type    uniform;
    Q       0;
    min     0.5;
    max     1;
}
Source files
See also
Foam::distribution

Definition at line 65 of file uniform.H.

Constructor & Destructor Documentation

◆ uniform() [1/2]

uniform ( const unitConversion units,
const dictionary dict,
const label  sampleQ,
randomGenerator &&  rndGen 
)

Construct from a dictionary.

Definition at line 58 of file uniform.C.

Referenced by uniform::clone().

Here is the caller graph for this function:

◆ uniform() [2/2]

uniform ( const uniform d,
const label  sampleQ 
)

Construct copy.

Definition at line 84 of file uniform.C.

◆ ~uniform()

~uniform ( )
virtual

Destructor.

Definition at line 96 of file uniform.C.

Member Function Documentation

◆ TypeName()

TypeName ( "uniform"  )

Runtime type information.

◆ clone()

virtual autoPtr<distribution> clone ( const label  sampleQ) const
inlinevirtual

Construct and return a clone.

Implements distribution.

Definition at line 111 of file uniform.H.

References uniform::uniform().

Here is the call graph for this function:

◆ sample()

Foam::scalar sample ( ) const
virtual

Sample the distribution.

Implements distribution.

Definition at line 102 of file uniform.C.

References Foam::integerRoot(), Foam::pow(), and s().

Here is the call graph for this function:

◆ min()

Foam::scalar min ( ) const
virtual

Return the minimum value.

Implements distribution.

Definition at line 119 of file uniform.C.

◆ max()

Foam::scalar max ( ) const
virtual

Return the maximum value.

Implements distribution.

Definition at line 125 of file uniform.C.

◆ mean()

Foam::scalar mean ( ) const
virtual

Return the mean value.

Implements distribution.

Definition at line 131 of file uniform.C.

References Foam::integerPow(), and Foam::log().

Here is the call graph for this function:

◆ write()

void write ( Ostream os,
const unitConversion units 
) const
virtual

Write to a stream.

Reimplemented from distribution.

Definition at line 147 of file uniform.C.

References Foam::units(), distribution::write(), and Foam::writeEntry().

Here is the call graph for this function:

◆ PDF()

Foam::tmp< Foam::scalarField > PDF ( const scalarField x) const
virtual

Return the distribution probability density function.

Implements distribution.

Definition at line 161 of file uniform.C.

References Foam::integerPow(), Foam::log(), and x.

Here is the call graph for this function:

The documentation for this class was generated from the following files: