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;
104 return round(GaussNormal<scalar>());
115 return start + scalar01()*(
end - start);
126 <<
"start index " << start <<
" > end index " <<
end <<
nl 135 const label val = start + label(scalar01()*(
end - start + 1));
166 value = round(scalar01());
182 value = GaussNormal<scalar>();
198 value = GaussNormal<label>();
218 value = position<scalar>(start,
end);
238 value = position<label>(start,
end);
Type globalGaussNormal()
Return a sample whose components are normally distributed with zero mean and unity variance N(0...
void reset(const label seedValue)
Reset the random number generator seed.
Calculate the second temporal derivative.
Inter-processor communication reduction functions.
dimensionedScalar log(const dimensionedScalar &ds)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
constexpr char nl
The newline '\n' character (0x0a)
dimensionedScalar sqrt(const dimensionedScalar &ds)
static void broadcast(Type &value, const label comm=UPstream::worldComm)
Broadcast content (contiguous or non-contiguous) to all processes in communicator.
Type sample01()
Return a sample whose components lie in the range [0,1].
Random(const label seedValue=defaultSeed)
Construct with seed value.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
errorManip< error > abort(error &err)
Type globalPosition(const Type &start, const Type &end)
Return a sample on the interval [start,end].
constexpr auto end(C &c) -> decltype(c.end())
Return iterator to the end of the container c.
Type globalSample01()
Return a sample whose components lie in the range [0,1].
static bool master(const label communicator=worldComm)
Am I the master rank.
void seed(uint32_t val=default_seed)
Reseed the generator.
Type GaussNormal()
Return a sample whose components are normally distributed with zero mean and unity variance N(0...
Type position(const Type &start, const Type &end)
Return a sample on the interval [start,end].