FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

Random Class Reference

Simple random number generator. More...

#include <OpenFOAM/Random.H>


Detailed Description

Simple random number generator.

Source files

Definition at line 50 of file Random.H.

List of all members.

Public Member Functions

 Random (const label &)
 Construct given seed.
int  bit ()
scalar  scalar01 ()
 scalar [0..1] (so including 0,1)
vector  vector01 ()
 vector with every component scalar01
sphericalTensor  sphericalTensor01 ()
 sphericalTensor with every component scalar01
symmTensor  symmTensor01 ()
 symmTensor with every component scalar01
tensor  tensor01 ()
 tensor with every component scalar01
label  integer (const label lower, const label upper)
 label [lower..upper]
vector  position (const vector &, const vector &)
void  randomise (scalar &)
void  randomise (vector &)
void  randomise (sphericalTensor &)
void  randomise (symmTensor &)
void  randomise (tensor &)
scalar  GaussNormal ()
 Return a normal Gaussian randon number.

Constructor & Destructor Documentation

Random ( const label &   seed  )

Construct given seed.

Definition at line 50 of file Random_.C.


Member Function Documentation

int bit (  )

Definition at line 70 of file Random_.C.

sphericalTensor sphericalTensor01 (  )

sphericalTensor with every component scalar01

Definition at line 109 of file Random_.C.

References SphericalTensor< Cmpt >::ii(), and Random::scalar01().

Referenced by Random::randomise().

symmTensor symmTensor01 (  )

symmTensor with every component scalar01

Definition at line 118 of file Random_.C.

References VectorSpace< Form, Cmpt, nCmpt >::component(), VectorSpace< SymmTensor< Cmpt >, Cmpt, 6 >::nComponents, and Random::scalar01().

Referenced by Random::randomise().

tensor tensor01 (  )

tensor with every component scalar01

Definition at line 130 of file Random_.C.

References VectorSpace< Form, Cmpt, nCmpt >::component(), VectorSpace< Tensor< scalar >, scalar, 9 >::nComponents, and Random::scalar01().

Referenced by Random::randomise().

label integer ( const label   lower,
const label   upper  
)

label [lower..upper]

Definition at line 142 of file Random_.C.

vector position ( const vector &   start,
const vector &   end  
)
void randomise ( scalar &   s  )

Definition at line 166 of file Random_.C.

References Random::scalar01().

Referenced by randomise::writeRandomField().

void randomise ( vector &   v  )

Definition at line 172 of file Random_.C.

References Random::vector01().

void randomise ( sphericalTensor &   st  )

Definition at line 178 of file Random_.C.

References Random::sphericalTensor01().

void randomise ( symmTensor &   st  )

Definition at line 184 of file Random_.C.

References Random::symmTensor01().

void randomise ( tensor &   t  )

Definition at line 190 of file Random_.C.

References Random::tensor01().

scalar GaussNormal (  )

Return a normal Gaussian randon number.

with zero mean and unity variance N(0, 1)

Definition at line 199 of file Random_.C.

References Foam::log(), Random::scalar01(), Foam::sqrt(), v1, and v2.


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