Public Member Functions | List of all members
Random Class Reference

Simple random number generator. More...

Public Member Functions

 Random (const label)
 Construct given seed. More...
 
int bit ()
 
scalar scalar01 ()
 Scalar [0..1] (so including 0,1) More...
 
vector vector01 ()
 Vector with every component scalar01. More...
 
sphericalTensor sphericalTensor01 ()
 sphericalTensor with every component scalar01 More...
 
symmTensor symmTensor01 ()
 symmTensor with every component scalar01 More...
 
tensor tensor01 ()
 Tensor with every component scalar01. More...
 
label integer (const label lower, const label upper)
 Label [lower..upper]. More...
 
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. More...
 

Detailed Description

Simple random number generator.

Source files

Definition at line 49 of file Random.H.

Constructor & Destructor Documentation

Random ( const label  seed)

Construct given seed.

Definition at line 39 of file Random.C.

References Foam::osRandomSeed().

Here is the call graph for this function:

Member Function Documentation

int bit ( )

Definition at line 54 of file Random.C.

References Foam::osRandomInteger().

Here is the call graph for this function:

Foam::scalar scalar01 ( )
Foam::vector vector01 ( )

Vector with every component scalar01.

Definition at line 73 of file Random.C.

References VectorSpace< Form, Cmpt, Ncmpts >::component(), VectorSpace< Vector< scalar >, scalar, 3 >::nComponents, and Random::scalar01().

Referenced by treeBoundBox::extend(), Random::randomise(), and turbGen::U().

Here is the call graph for this function:

Here is the caller graph for this function:

Foam::sphericalTensor sphericalTensor01 ( )

sphericalTensor with every component scalar01

Definition at line 85 of file Random.C.

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

Referenced by Random::randomise().

Here is the call graph for this function:

Here is the caller graph for this function:

Foam::symmTensor symmTensor01 ( )

symmTensor with every component scalar01

Definition at line 94 of file Random.C.

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

Referenced by Random::randomise().

Here is the call graph for this function:

Here is the caller graph for this function:

Foam::tensor tensor01 ( )

Tensor with every component scalar01.

Definition at line 106 of file Random.C.

References VectorSpace< Form, Cmpt, Ncmpts >::component(), VectorSpace< Tensor< scalar >, scalar, Mrows *Ncols >::nComponents, and Random::scalar01().

Referenced by Random::randomise().

Here is the call graph for this function:

Here is the caller graph for this function:

Foam::label integer ( const label  lower,
const label  upper 
)

Label [lower..upper].

Definition at line 118 of file Random.C.

References Foam::osRandomInteger().

Referenced by randomRenumber::renumber().

Here is the call graph for this function:

Here is the caller graph for this function:

Foam::vector position ( const vector start,
const vector end 
)

Definition at line 124 of file Random.C.

References VectorSpace< Form, Cmpt, Ncmpts >::component(), VectorSpace< Vector< scalar >, scalar, 3 >::nComponents, and Random::scalar01().

Here is the call graph for this function:

void randomise ( scalar &  s)

Definition at line 138 of file Random.C.

References Random::scalar01().

Here is the call graph for this function:

void randomise ( vector v)

Definition at line 144 of file Random.C.

References Random::vector01().

Here is the call graph for this function:

void randomise ( sphericalTensor st)

Definition at line 150 of file Random.C.

References Random::sphericalTensor01().

Here is the call graph for this function:

void randomise ( symmTensor st)

Definition at line 156 of file Random.C.

References Random::symmTensor01().

Here is the call graph for this function:

void randomise ( tensor t)

Definition at line 162 of file Random.C.

References Random::tensor01().

Here is the call graph for this function:

Foam::scalar GaussNormal ( )

Return a normal Gaussian randon number.

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

Definition at line 168 of file Random.C.

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

Here is the call graph for this function:


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