unintegrable Class Referenceabstract

Base class for distributions that do not have a closed integral form for the cumulative density function (CDF) for some or all effective size exponents. More...

Inheritance diagram for unintegrable:
Collaboration diagram for unintegrable:

Public Member Functions

 unintegrable (const word &name, const unitConversion &units, const dictionary &dict, const label sampleQ, randomGenerator &&rndGen)
 Construct from a dictionary. More...
 
 unintegrable (const label Q, const label sampleQ, randomGenerator &&rndGen, const label n)
 Construct from components. More...
 
 unintegrable (const unintegrable &d, const label sampleQ)
 Construct copy. More...
 
virtual ~unintegrable ()
 Destructor. More...
 
virtual scalar sample () const
 Sample the distribution. More...
 
virtual scalar mean () const
 Return the mean value. More...
 
virtual tmp< scalarFieldintegralPDFxPow (const scalarField &x, const label e, const bool consistent=false) const
 Return the integral of the PDF multiplied by an integer power of x. More...
 
virtual void write (Ostream &os, const unitConversion &units) const
 Write to a stream. More...
 
virtual tmp< scalarFieldplotPDF (const scalarField &x) const
 Return values to plot the probability density function. More...
 
virtual scalar sample () const=0
 Sample the distribution. More...
 
template<class Type >
Type sample () const
 Sample the distribution. More...
 
virtual tmp< scalarFieldsample (const label n) const=0
 Sample the distribution. More...
 
virtual tmp< scalarFieldplotX (const label n) const
 Return coordinates to plot across the range of the distribution. More...
 
- Public Member Functions inherited from distribution
 TypeName ("distribution")
 Runtime type information. More...
 
 declareRunTimeSelectionTable (autoPtr, distribution, dictionary,(const unitConversion &units, const dictionary &dict, const label sampleQ, randomGenerator &&rndGen),(units, dict, sampleQ, std::move(rndGen)))
 Declare runtime constructor selection table. More...
 
 distribution (const word &name, const unitConversion &units, const dictionary &dict, const label sampleQ, randomGenerator &&rndGen)
 Construct from dictionary. More...
 
 distribution (const label Q, const label sampleQ, randomGenerator &&rndGen)
 Construct from components. More...
 
 distribution (const distribution &d, const label sampleQ)
 Construct copy. More...
 
virtual autoPtr< distributionclone (const label sampleQ) const =0
 Construct and return a clone. More...
 
autoPtr< distributionclone () const
 Construct and return a clone. More...
 
virtual ~distribution ()
 Destructor. More...
 
label sampleQ () const
 Access the sample size exponent. More...
 
void start (const bool repeat) const
 Start a sequence of samples. Either a new sequence, or a. More...
 
template<class Type >
Type sample () const
 Sample the distribution into components of a primitive type. More...
 
virtual tmp< scalarFieldsample (const label n) const =0
 Sample the distribution into a field. More...
 
virtual scalar min () const =0
 Return the minimum value. More...
 
virtual scalar max () const =0
 Return the maximum value. More...
 
virtual tmp< scalarFieldCDF (const scalarField &x) const
 Return the cumulative density function at the given coordinates. More...
 
virtual void writeState (Ostream &os) const
 Write the state to a stream. More...
 
virtual tmp< scalarFieldplotX (const label n) const
 Return coordinates to plot across the range of the distribution. More...
 

Static Public Member Functions

static tmp< scalarFieldintegrate (const scalarField &x, const scalarField &y)
 Integrate the values y with respect to the coordinates x. More...
 
static tmp< scalarFieldintegrateX (const scalarField &x, const scalarField &y)
 Integrate the values x*y with respect to the coordinates x. More...
 
static tmp< scalarFieldinterpolateIntegrateXPow (const scalarField &xStar, const label e, const scalarField &yStar, const scalarField &x)
 Integrate the values x^e*y with respect to the coordinates x,. More...
 
static scalar sampleInterval (const Pair< scalar > &x, const Pair< scalar > &Phi, const scalar s)
 Sample an interval, given the interval's bounding x-coordinates,. More...
 
static scalar sampleInterval (const Pair< scalar > &x, const Pair< scalar > &phi, const Pair< scalar > &Phi, const scalar s)
 Sample an interval, given the interval's bounding x-coordinates,. More...
 
static scalar sample (const scalarField &x, const scalarField &Phi, const scalar s)
 Sample a discretised distribution, given the x-coordinates,. More...
 
static scalar sample (const scalarField &x, const scalarField &phi, const scalarField &Phi, const scalar s)
 Sample a discretised distribution, given the x-coordinates, values. More...
 
- Static Public Member Functions inherited from distribution
static autoPtr< distributionNew (const unitConversion &units, const dictionary &dict, const label sampleQ, randomGenerator &&rndGen, const bool report=true)
 Select from dictionary and a random generator. More...
 
static autoPtr< distributionNew (const unitConversion &units, const dictionary &dict, const label sampleQ, const randomGenerator::seed &s, const bool global=false, const bool report=true)
 Select from a dictionary and a random generator seed and global flag. More...
 
static autoPtr< distributionNew (autoPtr< distribution > &dPtr, const label sampleQ)
 Re-select with a different sample size exponent. More...
 

Protected Member Functions

virtual tmp< scalarFieldphi (const label q, const scalarField &x) const =0
 Return values of the un-normalised PDF for the given size exponent. More...
 
virtual tmp< scalarFieldPhi (const label q, const scalarField &x) const
 Return values of the un-normalised CDF for the given size exponent. More...
 
virtual Pair< scalar > Phi01 (const label q) const
 Return values of the un-normalised CDF at the minimum and maximum. More...
 
const Pair< scalar > & Phi01 () const
 Access cached values of the un-normalised CDF at the minimum and. More...
 
- Protected Member Functions inherited from distribution
virtual void validateBounds (const dictionary &dict) const
 Validate that the bounds are monotonic. More...
 
virtual void validatePositive (const dictionary &dict) const
 Validate that the lower bound is positive. More...
 
tmp< scalarFieldclipPDF (const scalarField &x, const tmp< scalarField > &pdf) const
 Clip the PDF values to zero outside the bounds. More...
 
label q () const
 Return the effective distribution size exponent. More...
 
 FOR_ALL_FIELD_TYPES (VIRTUAL_SAMPLE_TYPE)
 

Additional Inherited Members

- Protected Attributes inherited from distribution
const label Q_
 Distribution size exponent. More...
 
const label sampleQ_
 Sample size exponent. More...
 
restartableRandomGenerator rndGen_
 Random number generator. More...
 

Detailed Description

Base class for distributions that do not have a closed integral form for the cumulative density function (CDF) for some or all effective size exponents.

Source files
See also
Foam::distribution

Definition at line 55 of file unintegrable.H.

Constructor & Destructor Documentation

◆ unintegrable() [1/3]

unintegrable ( const word name,
const unitConversion units,
const dictionary dict,
const label  sampleQ,
randomGenerator &&  rndGen 
)

Construct from a dictionary.

Definition at line 352 of file unintegrable.C.

◆ unintegrable() [2/3]

unintegrable ( const label  Q,
const label  sampleQ,
randomGenerator &&  rndGen,
const label  n 
)

Construct from components.

Definition at line 366 of file unintegrable.C.

◆ unintegrable() [3/3]

unintegrable ( const unintegrable d,
const label  sampleQ 
)

Construct copy.

Definition at line 379 of file unintegrable.C.

References distribution::q().

Here is the call graph for this function:

◆ ~unintegrable()

~unintegrable ( )
virtual

Destructor.

Definition at line 410 of file unintegrable.C.

Member Function Documentation

◆ phi()

virtual tmp<scalarField> phi ( const label  q,
const scalarField x 
) const
protectedpure virtual

Return values of the un-normalised PDF for the given size exponent.

and x-coordinates. Must be provided by derivations.

◆ Phi()

Foam::tmp< Foam::scalarField > Phi ( const label  q,
const scalarField x 
) const
protectedvirtual

Return values of the un-normalised CDF for the given size exponent.

and x-coordinates. Can be overloaded by derivations, for example, if there is a simpler analytic solution for certain effective size exponents (probably zero).

Reimplemented in unintegrableForNonZeroQ.

Definition at line 319 of file unintegrable.C.

References x.

Referenced by unintegrableForNonZeroQ::Phi().

Here is the caller graph for this function:

◆ Phi01() [1/2]

Foam::Pair< Foam::scalar > Phi01 ( const label  q) const
protectedvirtual

Return values of the un-normalised CDF at the minimum and maximum.

x-coordinates for the given size exponent. Can be overloaded by derivations, for example, if there is a simpler analytic solution for certain effective size exponents (probably zero).

Reimplemented in unintegrableForNonZeroQ.

Definition at line 329 of file unintegrable.C.

References UList< T >::first(), UList< T >::last(), and x.

Here is the call graph for this function:

◆ Phi01() [2/2]

const Foam::Pair< Foam::scalar > & Phi01 ( ) const
protected

Access cached values of the un-normalised CDF at the minimum and.

maximum x-coordinates.

Definition at line 340 of file unintegrable.C.

Referenced by unintegrableForNonZeroQ::Phi01().

Here is the caller graph for this function:

◆ integrate()

Foam::tmp< Foam::scalarField > integrate ( const scalarField x,
const scalarField y 
)
static

Integrate the values y with respect to the coordinates x.

Definition at line 33 of file unintegrable.C.

References tmp< T >::ref(), x, and y.

Referenced by waveSpectrum::integralS(), tabulatedCumulative::mean(), tabulatedDensity::tabulatedDensity(), cloudSurfaceDistribution::write(), and tabulatedDensity::write().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ integrateX()

Foam::tmp< Foam::scalarField > integrateX ( const scalarField x,
const scalarField y 
)
static

Integrate the values x*y with respect to the coordinates x.

Definition at line 53 of file unintegrable.C.

References tmp< T >::ref(), x, y, Foam::y0(), and Foam::y1().

Referenced by waveSpectrum::integralFS(), and tabulatedDensity::mean().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ interpolateIntegrateXPow()

Foam::tmp< Foam::scalarField > interpolateIntegrateXPow ( const scalarField xStar,
const label  e,
const scalarField yStar,
const scalarField x 
)
static

Integrate the values x^e*y with respect to the coordinates x,.

and interpolating onto a separate set of x coordinates

Definition at line 78 of file unintegrable.C.

References Foam::e, Foam::integerPow(), Foam::log(), tmp< T >::ref(), List< T >::size(), and x.

Referenced by tabulatedDensity::integralPDFxPow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sampleInterval() [1/2]

Foam::scalar sampleInterval ( const Pair< scalar > &  x,
const Pair< scalar > &  Phi,
const scalar  s 
)
static

Sample an interval, given the interval's bounding x-coordinates,.

values Phi (the un-normalised CDF), and a random sample. First order interpolation.

Definition at line 143 of file unintegrable.C.

References f(), s(), and x.

Here is the call graph for this function:

◆ sampleInterval() [2/2]

Foam::scalar sampleInterval ( const Pair< scalar > &  x,
const Pair< scalar > &  phi,
const Pair< scalar > &  Phi,
const scalar  s 
)
static

Sample an interval, given the interval's bounding x-coordinates,.

values phi and Phi (the un-normalised PDF and CDF), and a random sample. Second order interpolation.

Definition at line 158 of file unintegrable.C.

References b, Foam::constant::universal::c, f(), forAll, Foam::real, quadraticEqn::roots(), s(), Roots< N >::type(), and x.

Here is the call graph for this function:

◆ sample() [1/6]

Foam::scalar sample ( const scalarField x,
const scalarField Phi,
const scalar  s 
)
static

Sample a discretised distribution, given the x-coordinates,.

values Phi (the un-normalised CDF), and a random sample. First order interpolation.

Definition at line 193 of file unintegrable.C.

◆ sample() [2/6]

Foam::scalar sample ( const scalarField x,
const scalarField phi,
const scalarField Phi,
const scalar  s 
)
static

Sample a discretised distribution, given the x-coordinates, values.

phi and Phi (the un-normalised PDF and CDF), and a random sample. Second order interpolation.

Definition at line 215 of file unintegrable.C.

References s(), and x.

Here is the call graph for this function:

◆ sample() [3/6]

Foam::scalar sample ( ) const
virtual

Sample the distribution.

Implements distribution.

Reimplemented in unintegrableForNonZeroQ.

Definition at line 416 of file unintegrable.C.

References s(), and x.

Referenced by waveSpectrum::fFraction(), tabulatedCumulative::sample(), tabulatedDensity::sample(), and unintegrableForNonZeroQ::sample().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mean()

Foam::scalar mean ( ) const
virtual

Return the mean value.

Implements distribution.

Definition at line 434 of file unintegrable.C.

References UList< T >::first(), UList< T >::last(), and x.

Referenced by normal::mean().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ integralPDFxPow()

Foam::tmp< Foam::scalarField > integralPDFxPow ( const scalarField x,
const label  e,
const bool  consistent = false 
) const
virtual

Return the integral of the PDF multiplied by an integer power of x.

Implements distribution.

Reimplemented in unintegrableForNonZeroQ.

Definition at line 444 of file unintegrable.C.

References x.

Referenced by unintegrableForNonZeroQ::integralPDFxPow().

Here is the caller graph for this function:

◆ write()

void write ( Ostream os,
const unitConversion units 
) const
virtual

Write to a stream.

Reimplemented from distribution.

Definition at line 455 of file unintegrable.C.

References n, Foam::units(), distribution::write(), and Foam::writeEntryIfDifferent().

Here is the call graph for this function:

◆ plotPDF()

Foam::tmp< Foam::scalarField > plotPDF ( const scalarField x) const
virtual

Return values to plot the probability density function.

Implements distribution.

Definition at line 472 of file unintegrable.C.

References x.

◆ sample() [4/6]

virtual scalar sample

Sample the distribution.

◆ sample() [5/6]

Type sample ( class Type  )

Sample the distribution.

◆ sample() [6/6]

virtual tmp<scalarField> sample

Sample the distribution.

◆ plotX()

Return coordinates to plot across the range of the distribution.

Definition at line 261 of file distribution.C.


The documentation for this class was generated from the following files: