33 namespace distributions
43 Foam::scalar Foam::distributions::uniform::Phi(
const scalar
x)
const
74 min_(
dict.lookupBackwardsCompatible<scalar>({
"min",
"minValue"},
units)),
75 max_(
dict.lookupBackwardsCompatible<scalar>({
"max",
"maxValue"},
units)),
80 if (q() != 0) validatePositive(
dict);
104 const scalar
s = rndGen_.sample01<scalar>();
108 return min_*
pow(max_/min_,
s);
112 const scalar PhiS = (1 -
s)*Phi0_ +
s*Phi1_;
135 return Foam::log(max_/min_)/(Phi1_ - Phi0_);
139 const scalar Mu0 =
integerPow(min_, 2 + q())/(2 + q());
140 const scalar Mu1 =
integerPow(max_, 2 + q())/(2 + q());
142 return (Mu1 - Mu0)/(Phi1_ - Phi0_);
Macros for easy insertion into run-time selection tables.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A list of keyword definitions, which are a keyword followed by any number of values (e....
Base class for statistical distributions.
label q() const
Return the effective distribution size exponent.
virtual tmp< scalarField > x(const label n) const
Return coordinates to plot across the range of the distribution.
virtual void write(Ostream &os, const unitConversion &units) const
Write to a stream.
A class for managing temporary objects.
Unit conversion structure. Contains the associated dimensions and the multiplier with which to conver...
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.name(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
defineTypeNameAndDebug(exponential, 0)
addToRunTimeSelectionTable(distribution, exponential, dictionary)
scalar integerRoot(const scalar x, const label e)
Compute the power of the number x to the reciprocal integer 1/e.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
scalar integerPow(const scalar x, const label e)
Compute the power of the number x to the integer e.
dimensionedScalar log(const dimensionedScalar &ds)
const HashTable< unitConversion > & units()
Get the table of unit conversions.
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
randomGenerator rndGen(653213)