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 50 of file Random.H.

Constructor & Destructor Documentation

Random ( const label  seed)

Construct given seed.

Definition at line 45 of file Random.C.

References Foam::osRandomSeed().

Here is the call graph for this function:

Member Function Documentation

int bit ( )

Definition at line 60 of file Random.C.

References Foam::osRandomInteger().

Here is the call graph for this function:

scalar scalar01 ( )

scalar [0..1] (so including 0,1)

Definition at line 73 of file Random.C.

References Foam::osRandomDouble().

Referenced by Random::GaussNormal(), Random::position(), Random::randomise(), triangle< Point, PointRef >::randomPoint(), tetrahedron< Point, PointRef >::randomPoint(), Random::sphericalTensor01(), Random::symmTensor01(), Random::tensor01(), and Random::vector01().

Here is the call graph for this function:

Here is the caller graph for this function:

vector vector01 ( )

vector with every component scalar01

Definition at line 79 of file Random.C.

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

sphericalTensor sphericalTensor01 ( )

sphericalTensor with every component scalar01

Definition at line 91 of file Random.C.

References Random::scalar01().

Referenced by Random::randomise().

Here is the call graph for this function:

Here is the caller graph for this function:

symmTensor symmTensor01 ( )

symmTensor with every component scalar01

Definition at line 100 of file Random.C.

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

Referenced by Random::randomise().

Here is the call graph for this function:

Here is the caller graph for this function:

tensor tensor01 ( )

tensor with every component scalar01

Definition at line 112 of file Random.C.

References Random::scalar01().

Referenced by Random::randomise().

Here is the call graph for this function:

Here is the caller graph for this function:

label integer ( const label  lower,
const label  upper 
)

label [lower..upper]

Definition at line 124 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:

vector position ( const vector start,
const vector end 
)

Definition at line 130 of file Random.C.

References Random::scalar01().

Here is the call graph for this function:

void randomise ( scalar &  s)

Definition at line 144 of file Random.C.

References Random::scalar01().

Referenced by randomise::writeRandomField().

Here is the call graph for this function:

Here is the caller graph for this function:

void randomise ( vector v)

Definition at line 150 of file Random.C.

References Random::vector01().

Here is the call graph for this function:

void randomise ( sphericalTensor st)

Definition at line 156 of file Random.C.

References Random::sphericalTensor01().

Here is the call graph for this function:

void randomise ( symmTensor st)

Definition at line 162 of file Random.C.

References Random::symmTensor01().

Here is the call graph for this function:

void randomise ( tensor t)

Definition at line 168 of file Random.C.

References Random::tensor01().

Here is the call graph for this function:

scalar GaussNormal ( )

Return a normal Gaussian randon number.

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

Definition at line 177 of file Random.C.

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

Here is the call graph for this function:


The documentation for this class was generated from the following files:
  • src/OpenFOAM/primitives/random/Random/Random.H
  • src/OpenFOAM/primitives/random/Random/Random.C