Loading...
Searching...
No Matches
distributionModel Class Referenceabstract

A library of runtime-selectable doubly-truncated probability distribution models. Returns random samples based on given distribution parameters. More...

#include <distributionModel.H>

Inheritance diagram for distributionModel:
Collaboration diagram for distributionModel:

Public Member Functions

 TypeName ("distributionModel")
 Runtime type information.
 declareRunTimeSelectionTable (autoPtr, distributionModel, dictionary,(const dictionary &dict, Random &rndGen),(dict, rndGen))
 Declare runtime constructor selection table.
 distributionModel (const word &name, const dictionary &dict, Random &rndGen)
 Construct from dictionary.
 distributionModel (const distributionModel &p)
 Copy construct.
virtual autoPtr< distributionModelclone () const =0
 Construct and return a clone.
virtual ~distributionModel ()=default
 Destructor.
virtual scalar sample () const =0
 Sample the distribution.
virtual scalar minValue () const
 Return the minimum of the distribution.
virtual scalar maxValue () const
 Return the maximum of the distribution.
virtual scalar meanValue () const =0
 Return the theoretical mean of the distribution, or the arithmetic mean of the distribution data.

Static Public Member Functions

static autoPtr< distributionModelNew (const dictionary &dict, Random &rndGen)
 Selector.

Protected Member Functions

virtual void check () const
 Check that the distribution model is valid.

Protected Attributes

const dictionary distributionModelDict_
 Coefficients dictionary.
RandomrndGen_
 Reference to the random number generator.
scalar minValue_
 Minimum of the distribution.
scalar maxValue_
 Maximum of the distribution.

Detailed Description

A library of runtime-selectable doubly-truncated probability distribution models. Returns random samples based on given distribution parameters.

Available distribution models include:

  • binned
  • exponential
  • fixedValue
  • general
  • multi-normal
  • normal
  • Rosin-Rammler
  • Mass-based Rosin-Rammler
  • uniform
Source files

Definition at line 69 of file distributionModel.H.

Constructor & Destructor Documentation

◆ distributionModel() [1/2]

◆ distributionModel() [2/2]

distributionModel ( const distributionModel & p)

Copy construct.

Definition at line 84 of file distributionModel.C.

References distributionModel(), distributionModelDict_, maxValue_, minValue_, p, and rndGen_.

Here is the call graph for this function:

◆ ~distributionModel()

virtual ~distributionModel ( )
virtualdefault

Destructor.

Member Function Documentation

◆ check()

void check ( ) const
protectedvirtual

Check that the distribution model is valid.

Definition at line 35 of file distributionModel.C.

References Foam::abort(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, maxValue(), minValue(), Foam::nl, Foam::type(), and WarningInFunction.

Referenced by binned::binned(), exponential::exponential(), general::general(), and uniform::uniform().

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

◆ TypeName()

TypeName ( "distributionModel" )

Runtime type information.

◆ declareRunTimeSelectionTable()

declareRunTimeSelectionTable ( autoPtr ,
distributionModel ,
dictionary ,
(const dictionary &dict, Random &rndGen) ,
(dict, rndGen)  )

Declare runtime constructor selection table.

References dict, distributionModel(), Foam::name(), p, and rndGen.

Here is the call graph for this function:

◆ clone()

virtual autoPtr< distributionModel > clone ( ) const
pure virtual

Construct and return a clone.

Implemented in binned, exponential, fixedValue, general, massRosinRammler, multiNormal, normal, RosinRammler, and uniform.

References dict, and rndGen.

◆ New()

Foam::autoPtr< Foam::distributionModel > New ( const dictionary & dict,
Random & rndGen )
static

Selector.

Definition at line 26 of file distributionModelNew.C.

References dict, Foam::endl(), Foam::exit(), Foam::FatalIOError, FatalIOErrorInLookup, Foam::Info, and rndGen.

Here is the call graph for this function:

◆ sample()

virtual scalar sample ( ) const
pure virtual

Sample the distribution.

Implemented in binned, exponential, fixedValue, general, massRosinRammler, multiNormal, normal, RosinRammler, and uniform.

◆ minValue()

Foam::scalar minValue ( ) const
virtual

Return the minimum of the distribution.

Reimplemented in fixedValue.

Definition at line 98 of file distributionModel.C.

References minValue_.

Referenced by check().

Here is the caller graph for this function:

◆ maxValue()

Foam::scalar maxValue ( ) const
virtual

Return the maximum of the distribution.

Reimplemented in fixedValue.

Definition at line 104 of file distributionModel.C.

References maxValue_.

Referenced by check().

Here is the caller graph for this function:

◆ meanValue()

virtual scalar meanValue ( ) const
pure virtual

Return the theoretical mean of the distribution, or the arithmetic mean of the distribution data.

Implemented in binned, exponential, fixedValue, general, massRosinRammler, multiNormal, normal, RosinRammler, and uniform.

Member Data Documentation

◆ distributionModelDict_

◆ rndGen_

◆ minValue_

◆ maxValue_


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