normal Class Reference

Normal distribution, scaled so that it spans between a specified minimum and maximum value, rather than from zero to infinity. More...

Inheritance diagram for normal:
Collaboration diagram for normal:

Public Member Functions

 TypeName ("normal")
 Runtime type information. More...
 
 normal (const unitConversion &units, const dictionary &dict, const label sampleQ, randomGenerator &&rndGen)
 Construct from a dictionary. More...
 
 normal (const label Q, const label sampleQ, randomGenerator &&rndGen, const label n, const scalar min, const scalar max, const scalar mu, const scalar sigma)
 Construct from components. More...
 
 normal (const normal &d, const label sampleQ)
 Construct copy. More...
 
virtual autoPtr< distributionclone (const label sampleQ) const
 Construct and return a clone. More...
 
virtual ~normal ()
 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...
 
scalar mu () const
 Return the mean value. More...
 
scalar sigma () const
 Return the standard deviation. More...
 
virtual void write (Ostream &os, const unitConversion &units) const
 Write to a stream. More...
 
virtual tmp< scalarFieldx (const label n) const
 Return coordinates to plot across the range of the distribution. More...
 
- Public Member Functions inherited from FieldDistribution< unintegrableForNonZeroQ, normal >
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...
 

Friends

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

Additional Inherited Members

- Protected Member Functions inherited from FieldDistribution< unintegrableForNonZeroQ, normal >
 FOR_ALL_FIELD_TYPES (VIRTUAL_SAMPLE_TYPE)
 

Detailed Description

Normal distribution, scaled so that it spans between a specified minimum and maximum value, rather than from zero to infinity.

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

Usage
Example usage:
{
    type    normal;
    Q       0;
    min     0.001;
    max     0.019;
    mu      0.011;
    sigma   0.003;
}
Source files
See also
Foam::distribution

Definition at line 71 of file normal.H.

Constructor & Destructor Documentation

◆ normal() [1/3]

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

Construct from a dictionary.

Definition at line 88 of file normal.C.

Referenced by normal::clone().

Here is the caller graph for this function:

◆ normal() [2/3]

normal ( const label  Q,
const label  sampleQ,
randomGenerator &&  rndGen,
const label  n,
const scalar  min,
const scalar  max,
const scalar  mu,
const scalar  sigma 
)

Construct from components.

Definition at line 115 of file normal.C.

◆ normal() [3/3]

normal ( const normal d,
const label  sampleQ 
)

Construct copy.

Definition at line 141 of file normal.C.

◆ ~normal()

~normal ( )
virtual

Destructor.

Definition at line 153 of file normal.C.

Member Function Documentation

◆ TypeName()

TypeName ( "normal"  )

Runtime type information.

◆ clone()

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

Construct and return a clone.

Definition at line 150 of file normal.H.

References normal::normal().

Here is the call graph for this function:

◆ sample()

Foam::scalar sample ( ) const
virtual

Sample the distribution.

Definition at line 159 of file normal.C.

References unintegrable::sample().

Here is the call graph for this function:

◆ min()

Foam::scalar min ( ) const
virtual

Return the minimum value.

Definition at line 172 of file normal.C.

◆ max()

Foam::scalar max ( ) const
virtual

Return the maximum value.

Definition at line 178 of file normal.C.

◆ mean()

Foam::scalar mean ( ) const
virtual

Return the mean value.

Definition at line 184 of file normal.C.

References unintegrable::mean().

Here is the call graph for this function:

◆ mu()

scalar mu ( ) const
inline

Return the mean value.

Definition at line 178 of file normal.H.

◆ sigma()

scalar sigma ( ) const
inline

Return the standard deviation.

Definition at line 184 of file normal.H.

◆ write()

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

Write to a stream.

Definition at line 205 of file normal.C.

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

Here is the call graph for this function:

◆ x()

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

Return coordinates to plot across the range of the distribution.

Definition at line 221 of file normal.C.

References Foam::max(), n, tmp< T >::ref(), and distribution::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 119 of file normal.H.


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