33 namespace distributions
44 auto Foam::distributions::uniform::Phi(
const Type&
x,
const label q)
75 min_(
dict.lookupBackwardsCompatible<scalar>({
"min",
"minValue"},
units)),
76 max_(
dict.lookupBackwardsCompatible<scalar>({
"max",
"maxValue"},
units)),
77 Phi0_(Phi(min_, q())),
81 if (q() != 0) validatePositive(
dict);
90 Phi0_(Phi(min_, q())),
105 const scalar
s = rndGen_.sample01<scalar>();
109 return min_*
pow(max_/min_,
s);
113 const scalar PhiS = (1 -
s)*Phi0_ +
s*Phi1_;
133 return (Phi(max_, q() + 1) - Phi(min_, q() + 1))/(Phi1_ - Phi0_);
146 return (Phi(xClip, q() +
e) - Phi(min_, q() +
e))/(Phi1_ - Phi0_);
168 return clipPDF(
x, 1/
x/
log(max_/min_));
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 keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Base class for statistical distributions.
label q() const
Return the effective distribution size exponent.
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(lagrangian::Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(lagrangian::Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(lagrangian::Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.name(), lagrangian::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)
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
const HashTable< unitConversion > & units()
Get the table of unit conversions.
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
void pow(LagrangianPatchField< typename powProduct< Type, r >::type > &f, const LagrangianPatchField< Type > &f1)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
randomGenerator rndGen(653213)