distributionModel Class Referenceabstract

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

Inheritance diagram for distributionModel:
[legend]
Collaboration diagram for distributionModel:
[legend]

Public Member Functions

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

Static Public Member Functions

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

Protected Member Functions

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

Protected Attributes

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

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 72 of file distributionModel.H.

Constructor & Destructor Documentation

◆ distributionModel() [1/2]

distributionModel ( const word name,
const dictionary dict,
Random rndGen 
)

Construct from dictionary.

Definition at line 77 of file distributionModel.C.

◆ distributionModel() [2/2]

Copy construct.

Definition at line 91 of file distributionModel.C.

◆ ~distributionModel()

virtual ~distributionModel ( )
virtualdefault

Destructor.

Member Function Documentation

◆ check()

void check ( ) const
protectedvirtual

Check that the distribution model is valid.

Definition at line 42 of file distributionModel.C.

References Foam::abort(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, distributionModel::maxValue(), distributionModel::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.

◆ 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.

◆ New()

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

Selector.

Definition at line 33 of file distributionModelNew.C.

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

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 105 of file distributionModel.C.

Referenced by distributionModel::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 111 of file distributionModel.C.

Referenced by distributionModel::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_

const dictionary distributionModelDict_
protected

Coefficients dictionary.

Definition at line 79 of file distributionModel.H.

◆ rndGen_

Random& rndGen_
protected

Reference to the random number generator.

Definition at line 82 of file distributionModel.H.

◆ minValue_

scalar minValue_
protected

Minimum of the distribution.

Definition at line 85 of file distributionModel.H.

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

◆ maxValue_

scalar maxValue_
protected

Maximum of the distribution.

Definition at line 88 of file distributionModel.H.

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


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