38 hasGaussSample_(false),
49 hasGaussSample_ =
false;
51 generator_.
seed(seed_);
68 return round(scalar01());
77 hasGaussSample_ =
false;
87 v1 = 2*scalar01() - 1;
88 v2 = 2*scalar01() - 1;
90 }
while (rsq >= 1 || rsq == 0);
94 gaussSample_ = v1*
fac;
95 hasGaussSample_ =
true;
115 return start + scalar01()*(end - start);
126 <<
"start index " << start <<
" > end index " << end <<
nl
135 const label val = start + label(scalar01()*(end - start + 1));
139 return min(val, end);
166 value = round(scalar01());
182 value = GaussNormal<scalar>();
198 value = GaussNormal<label>();
218 value = position<scalar>(start, end);
238 value = position<label>(start, end);
Inter-processor communication reduction functions.
void seed(uint32_t val=default_seed)
Reseed the generator.
Type position(const Type &start, const Type &end)
Return a sample on the interval [start,end].
Type GaussNormal()
Return a sample whose components are normally distributed with zero mean and unity variance N(0,...
Type sample01()
Return a sample whose components lie in the range [0,1].
Type globalSample01()
Return a sample whose components lie in the range [0,1].
void reset(const label seedValue)
Reset the random number generator seed.
Random(const label seedValue=defaultSeed)
Construct with seed value.
Type globalPosition(const Type &start, const Type &end)
Return a sample on the interval [start,end].
Type globalGaussNormal()
Return a sample whose components are normally distributed with zero mean and unity variance N(0,...
static bool master(const label communicator=worldComm)
True if process corresponds to the master rank in the communicator.
@ broadcast
broadcast [MPI]
limits reset(1/(limits.max()+VSMALL), 1/(limits.min()+VSMALL))
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
dimensionedScalar log(const dimensionedScalar &ds)
dimensionedScalar sqrt(const dimensionedScalar &ds)
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
errorManip< error > abort(error &err)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
constexpr char nl
The newline '\n' character (0x0a).
Calculate the second temporal derivative.