Public Member Functions | Private Attributes
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...
 

Private Attributes

label Seed
 

Detailed Description

Simple random number generator.

Source files

Definition at line 49 of file Random.H.

Constructor & Destructor Documentation

◆ Random()

Random ( const label  seed)

Construct given seed.

Definition at line 39 of file Random.C.

References Foam::osRandomSeed(), and Random::Seed.

Here is the call graph for this function:

Member Function Documentation

◆ bit()

int bit ( )

Definition at line 54 of file Random.C.

References Foam::osRandomInteger().

Here is the call graph for this function:

◆ scalar01()

Foam::scalar scalar01 ( )

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

Definition at line 67 of file Random.C.

References Foam::osRandomDouble().

Referenced by main().

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

◆ vector01()

Foam::vector vector01 ( )

Vector with every component scalar01.

Definition at line 73 of file Random.C.

References VectorSpace::component(), and VectorSpace< Vector< scalar >, scalar, 3 >::nComponents.

Referenced by ParticleCollector< CloudType >::initConcentricCircles().

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

◆ sphericalTensor01()

Foam::sphericalTensor sphericalTensor01 ( )

sphericalTensor with every component scalar01

Definition at line 85 of file Random.C.

References SphericalTensor< Cmpt >::ii().

Here is the call graph for this function:

◆ symmTensor01()

Foam::symmTensor symmTensor01 ( )

symmTensor with every component scalar01

Definition at line 94 of file Random.C.

References VectorSpace::component(), and VectorSpace< SymmTensor< scalar >, scalar, 6 >::nComponents.

Here is the call graph for this function:

◆ tensor01()

Foam::tensor tensor01 ( )

Tensor with every component scalar01.

Definition at line 106 of file Random.C.

◆ integer()

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 main().

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

◆ position()

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

Definition at line 124 of file Random.C.

References VectorSpace::component(), and VectorSpace< Vector< scalar >, scalar, 3 >::nComponents.

Here is the call graph for this function:

◆ randomise() [1/5]

void randomise ( scalar &  s)

Definition at line 138 of file Random.C.

References s().

Referenced by randomise::writeRandomField().

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

◆ randomise() [2/5]

void randomise ( vector v)

Definition at line 144 of file Random.C.

◆ randomise() [3/5]

void randomise ( sphericalTensor st)

Definition at line 150 of file Random.C.

◆ randomise() [4/5]

void randomise ( symmTensor st)

Definition at line 156 of file Random.C.

◆ randomise() [5/5]

void randomise ( tensor t)

Definition at line 162 of file Random.C.

◆ GaussNormal()

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(), Foam::sqr(), and Foam::sqrt().

Referenced by UOprocess::WeinerProcess().

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

Field Documentation

◆ Seed

label Seed
private

Definition at line 53 of file Random.H.

Referenced by Random::Random().


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