standardNormal Class Reference

Standard normal distribution. Not selectable. More...

Inheritance diagram for standardNormal:
Collaboration diagram for standardNormal:

Public Member Functions

 TypeName ("standardNormal")
 Runtime type information. More...
 
 standardNormal (randomGenerator &&rndGen)
 Construct from a random generator. More...
 
 standardNormal (const randomGenerator::seed &s, const bool global=false)
 Construct from a seed. More...
 
 standardNormal (const standardNormal &d)
 Construct copy. More...
 
virtual autoPtr< distributionclone (const label sampleQ) const
 Construct and return a clone. More...
 
virtual ~standardNormal ()
 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 tmp< scalarFieldx (const label n) const
 Return coordinates to plot across the range of the distribution. More...
 
virtual tmp< scalarFieldPDF (const scalarField &x) const
 Return the distribution probability density function. More...
 
- Public Member Functions inherited from FieldDistribution< distribution, standardNormal >
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 write (Ostream &os, const unitConversion &units) const
 Write to a stream. More...
 
virtual void writeState (Ostream &os) const
 Write the state to a stream. More...
 

Static Public Member Functions

static tmp< scalarFieldapproxErf (const scalarField &x)
 Approximate error function. More...
 
static scalar approxErfInv (const scalar y)
 Approximate error function inverse. More...
 
- 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...
 

Friends

class multiNormal
 Permit the multiNormal distribution to use private parts of this class. More...
 

Additional Inherited Members

- Protected Member Functions inherited from FieldDistribution< distribution, standardNormal >
 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

Standard normal distribution. Not selectable.

\[ PDF(x) = \frac{1}{\sqrt{2 \pi}} \exp \left( - \frac{1}{2} x^2 \right) \]

Source files
See also
Foam::distribution

Definition at line 57 of file standardNormal.H.

Constructor & Destructor Documentation

◆ standardNormal() [1/3]

Construct from a random generator.

Definition at line 67 of file standardNormal.C.

Referenced by standardNormal::clone().

Here is the caller graph for this function:

◆ standardNormal() [2/3]

standardNormal ( const randomGenerator::seed s,
const bool  global = false 
)

Construct from a seed.

Definition at line 73 of file standardNormal.C.

◆ standardNormal() [3/3]

Construct copy.

Definition at line 83 of file standardNormal.C.

◆ ~standardNormal()

~standardNormal ( )
virtual

Destructor.

Definition at line 91 of file standardNormal.C.

Member Function Documentation

◆ TypeName()

TypeName ( "standardNormal"  )

Runtime type information.

◆ approxErf()

Foam::tmp< Foam::scalarField > approxErf ( const scalarField x)
static

Approximate error function.

Definition at line 49 of file standardNormal.C.

References Foam::exp(), Foam::constant::mathematical::pi(), Foam::sign(), Foam::sqr(), Foam::sqrt(), and x.

Here is the call graph for this function:

◆ approxErfInv()

Foam::scalar approxErfInv ( const scalar  y)
static

Approximate error function inverse.

Definition at line 58 of file standardNormal.C.

References b, Foam::log(), Foam::constant::mathematical::pi(), Foam::sign(), Foam::sqrt(), and y.

Here is the call graph for this function:

◆ clone()

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

Construct and return a clone.

Implements distribution.

Definition at line 102 of file standardNormal.H.

References standardNormal::standardNormal().

Here is the call graph for this function:

◆ sample()

Foam::scalar sample ( ) const
virtual

Sample the distribution.

Implements distribution.

Definition at line 97 of file standardNormal.C.

References s(), and Foam::sqrt().

Referenced by BrownianMotionForce< CloudType >::calcCoupled(), MaxwellianThermal< CloudType >::correct(), MixedDiffuseSpecular< CloudType >::correct(), FreeStream< CloudType >::inflow(), GradientDispersionRAS< CloudType >::update(), and StochasticDispersionRAS< CloudType >::update().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ min()

Foam::scalar min ( ) const
virtual

Return the minimum value.

Implements distribution.

Definition at line 105 of file standardNormal.C.

◆ max()

Foam::scalar max ( ) const
virtual

Return the maximum value.

Implements distribution.

Definition at line 111 of file standardNormal.C.

◆ mean()

Foam::scalar mean ( ) const
virtual

Return the mean value.

Implements distribution.

Definition at line 117 of file standardNormal.C.

◆ x()

Foam::tmp< Foam::scalarField > x ( const label  n) const
virtual

Return coordinates to plot across the range of the distribution.

Reimplemented from distribution.

Definition at line 124 of file standardNormal.C.

References f(), forAll, n, and tmp< T >::ref().

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 142 of file standardNormal.C.

References Foam::exp(), Foam::constant::mathematical::pi(), Foam::sqr(), Foam::sqrt(), and x.

Here is the call graph for this function:

Friends And Related Function Documentation

◆ multiNormal

friend class multiNormal
friend

Permit the multiNormal distribution to use private parts of this class.

Definition at line 74 of file standardNormal.H.


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