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 |
Simple random number generator.
Construct given seed.
Definition at line 39 of file Random.C.
References Foam::osRandomSeed(), and Random::Seed.
int bit | ( | ) |
Definition at line 54 of file Random.C.
References Foam::osRandomInteger().
Foam::scalar scalar01 | ( | ) |
Scalar [0..1] (so including 0,1)
Definition at line 67 of file Random.C.
References Foam::osRandomDouble().
Referenced by main().
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().
Foam::sphericalTensor sphericalTensor01 | ( | ) |
sphericalTensor with every component scalar01
Definition at line 85 of file Random.C.
References SphericalTensor< Cmpt >::ii().
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.
Foam::tensor tensor01 | ( | ) |
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().
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.
void randomise | ( | scalar & | s | ) |
Definition at line 138 of file Random.C.
References s().
Referenced by randomise::writeRandomField().
void randomise | ( | sphericalTensor & | st | ) |
void randomise | ( | symmTensor & | st | ) |
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().
|
private |
Definition at line 53 of file Random.H.
Referenced by Random::Random().
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.