33 namespace distributionModels
49 minValue_(distributionModelDict_.template lookup<scalar>(
"minValue")),
50 maxValue_(distributionModelDict_.template lookup<scalar>(
"maxValue")),
51 range_(maxValue_ - minValue_),
52 expectation_(distributionModelDict_.lookup(
"expectation")),
53 variance_(distributionModelDict_.lookup(
"variance")),
54 strength_(distributionModelDict_.lookup(
"strength"))
59 label n = strength_.size();
62 scalar
x = expectation_[i];
63 scalar
s = strength_[i];
68 scalar x2 = (x - expectation_[j])/variance_[j];
69 scalar
y =
exp(-0.5*x2*x2);
89 minValue_(p.minValue_),
90 maxValue_(p.maxValue_),
92 expectation_(p.expectation_),
93 variance_(p.variance_),
94 strength_(p.strength_)
121 scalar nu = expectation_[i];
122 scalar
sigma = variance_[i];
123 scalar
s = strength_[i];
124 scalar v = (x - nu)/sigma;
125 p += s*
exp(-0.5*v*v);
155 mean += strength_[i]*expectation_[i];
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
A multiNormal distribution model.
Random & rndGen_
Reference to the random number generator.
A list of keyword definitions, which are a keyword followed by any number of values (e...
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
void size(const label)
Override size to be inconsistent with allocated storage.
multiNormal(const dictionary &dict, Random &rndGen)
Construct from components.
virtual scalar minValue() const
Return the minimum value.
Macros for easy insertion into run-time selection tables.
const dimensionedScalar sigma
Stefan-Boltzmann constant: default SI units: [W/m^2/K^4].
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.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Type sample01()
Advance the state and return a sample of a given type from a.
dimensionedScalar exp(const dimensionedScalar &ds)
virtual scalar meanValue() const
Return the mean value.
defineTypeNameAndDebug(exponential, 0)
virtual scalar maxValue() const
Return the maximum value.
A library of runtime-selectable distribution models.
virtual scalar sample() const
Sample the distributionModel.
addToRunTimeSelectionTable(distributionModel, exponential, dictionary)
virtual ~multiNormal()
Destructor.