33 namespace distributionModels
49 minValue_(
readScalar(distributionModelDict_.lookup(
"minValue"))),
50 maxValue_(
readScalar(distributionModelDict_.lookup(
"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);
87 minValue_(p.minValue_),
88 maxValue_(p.maxValue_),
90 expectation_(p.expectation_),
91 variance_(p.variance_),
92 strength_(p.strength_)
119 scalar
nu = expectation_[i];
120 scalar
sigma = variance_[i];
121 scalar
s = strength_[i];
122 scalar v = (x -
nu)/sigma;
123 p += s*
exp(-0.5*v*v);
153 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.
const dimensionedScalar sigma
Stefan-Boltzmann constant: default SI units: [W/m^2/K^4].
virtual scalar minValue() const
Return the minimum value.
Macros for easy insertion into run-time selection tables.
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.
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if successful.
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.