Random number generator. More...
Classes | |
class | gaussianGeneratorOp |
class | uniformGeneratorOp |
Public Member Functions | |
Random (const label seedValue=defaultSeed) | |
Random (const Random &rnd, const bool reset) | |
label | seed () const |
void | reset (const label seedValue) |
int | bit () |
template<class Type > | |
Type | sample01 () |
template<class Type > | |
Type | GaussNormal () |
template<class Type > | |
Type | position (const Type &start, const Type &end) |
template<class Type > | |
void | randomise01 (Type &value) |
template<class Type > | |
void | shuffle (UList< Type > &values) |
template<class Type > | |
Type | globalSample01 () |
template<class Type > | |
Type | globalGaussNormal () |
template<class Type > | |
Type | globalPosition (const Type &start, const Type &end) |
template<class Type > | |
void | globalRandomise01 (Type &value) |
template<> | |
Foam::scalar | sample01 () |
template<> | |
Foam::scalar | GaussNormal () |
template<> | |
Foam::scalar | position (const scalar &start, const scalar &end) |
template<> | |
Foam::label | position (const label &start, const label &end) |
template<> | |
Foam::scalar | globalSample01 () |
template<> | |
Foam::scalar | globalGaussNormal () |
template<> | |
Foam::scalar | globalPosition (const scalar &start, const scalar &end) |
template<> | |
Foam::label | globalPosition (const label &start, const label &end) |
template<> | |
scalar | sample01 () |
template<> | |
label | sample01 () |
template<> | |
scalar | GaussNormal () |
template<> | |
label | GaussNormal () |
template<> | |
scalar | position (const scalar &start, const scalar &end) |
template<> | |
label | position (const label &start, const label &end) |
template<> | |
scalar | globalSample01 () |
template<> | |
label | globalSample01 () |
template<> | |
scalar | globalGaussNormal () |
template<> | |
label | globalGaussNormal () |
template<> | |
scalar | globalPosition (const scalar &start, const scalar &end) |
template<> | |
label | globalPosition (const label &start, const label &end) |
Static Public Attributes | |
static constexpr label | defaultSeed = 123456 |
Random number generator.
|
explicit |
Definition at line 36 of file Random.C.
References Random::reset(), and Rand48::seed().
|
inline |
Definition at line 43 of file RandomI.H.
Referenced by Random::Random().
Type sample01 |
Definition at line 29 of file RandomTemplates.C.
Referenced by BrownianMotionForce< CloudType >::calcCoupled(), ConeInjection< CloudType >::ConeInjection(), treeBoundBox::extend(), InflationInjection< CloudType >::parcelsToInject(), patchInjectionBase::setPositionAndCell(), ConeInjection< CloudType >::setProperties(), StochasticDispersionRAS< CloudType >::update(), and SHF< CloudType >::update().
Type GaussNormal |
Definition at line 42 of file RandomTemplates.C.
Referenced by BrownianMotionForce< CloudType >::calcCoupled(), StochasticDispersionRAS< CloudType >::update(), and GradientDispersionRAS< CloudType >::update().
Type position | ( | const Type & | start, |
const Type & | end | ||
) |
Definition at line 55 of file RandomTemplates.C.
References stdFoam::end().
Referenced by InflationInjection< CloudType >::parcelsToInject(), randomRenumber::renumber(), massRosinRammler::sample(), patchInjectionBase::setPositionAndCell(), ReactingLookupTableInjection< CloudType >::setPositionAndCell(), ThermoLookupTableInjection< CloudType >::setPositionAndCell(), ReactingMultiphaseLookupTableInjection< CloudType >::setPositionAndCell(), KinematicLookupTableInjection< CloudType >::setPositionAndCell(), and ConeInjection< CloudType >::setProperties().
void randomise01 | ( | Type & | value | ) |
Definition at line 69 of file RandomTemplates.C.
void shuffle | ( | UList< Type > & | values | ) |
Definition at line 76 of file RandomTemplates.C.
References Foam::Swap(), and Foam::HashTableOps::values().
Referenced by eddy::eddy(), and ConeInjection< CloudType >::setPositionAndCell().
Type globalSample01 |
Definition at line 87 of file RandomTemplates.C.
References UPstream::master(), and Pstream::scatter().
Referenced by patchInjectionBase::setPositionAndCell().
Type globalGaussNormal |
Definition at line 103 of file RandomTemplates.C.
References UPstream::master(), and Pstream::scatter().
Type globalPosition | ( | const Type & | start, |
const Type & | end | ||
) |
Definition at line 119 of file RandomTemplates.C.
References stdFoam::end(), UPstream::master(), and Pstream::scatter().
Referenced by InjectedParticleDistributionInjection< CloudType >::initialise(), PatchFlowRateInjection< CloudType >::parcelsToInject(), PatchInjection< CloudType >::parcelsToInject(), and InjectedParticleDistributionInjection< CloudType >::setPositionAndCell().
void globalRandomise01 | ( | Type & | value | ) |
Definition at line 135 of file RandomTemplates.C.
References UPstream::master(), and Pstream::scatter().
Foam::label GaussNormal | ( | ) |
Definition at line 66 of file Random.C.
References Foam::log(), Foam::sqr(), and Foam::sqrt().
Foam::scalar position | ( | const scalar & | start, |
const scalar & | end | ||
) |
Definition at line 103 of file Random.C.
References stdFoam::end().
Foam::label position | ( | const label & | start, |
const label & | end | ||
) |
Definition at line 113 of file Random.C.
References Foam::abort(), stdFoam::end(), Foam::FatalError, FatalErrorInFunction, Foam::min(), and Foam::nl.
Foam::label globalSample01 | ( | ) |
Definition at line 137 of file Random.C.
References UPstream::master(), and Pstream::scatter().
Foam::label globalGaussNormal | ( | ) |
Definition at line 169 of file Random.C.
References UPstream::master(), and Pstream::scatter().
Foam::scalar globalPosition | ( | const scalar & | start, |
const scalar & | end | ||
) |
Definition at line 202 of file Random.C.
References stdFoam::end(), UPstream::master(), and Pstream::scatter().
Foam::label globalPosition | ( | const label & | start, |
const label & | end | ||
) |
Definition at line 222 of file Random.C.
References stdFoam::end(), Foam::labelMin, UPstream::master(), and Pstream::scatter().
scalar sample01 | ( | ) |
label sample01 | ( | ) |
scalar GaussNormal | ( | ) |
label GaussNormal | ( | ) |
scalar position | ( | const scalar & | start, |
const scalar & | end | ||
) |
label position | ( | const label & | start, |
const label & | end | ||
) |
scalar globalSample01 | ( | ) |
label globalSample01 | ( | ) |
scalar globalGaussNormal | ( | ) |
label globalGaussNormal | ( | ) |
scalar globalPosition | ( | const scalar & | start, |
const scalar & | end | ||
) |
label globalPosition | ( | const label & | start, |
const label & | end | ||
) |
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.