1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by
13 the Free Software Foundation, either version 3 of the License, or
14 (at your option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
28 A library of runtime-selectable PDF's.
30 Returns a sampled value given the expectation (nu) and variance (sigma^2)
32 Current PDF's include:
41 The pdf is tabulated in equidistant nPoints, in an interval.
42 These values are integrated to obtain the cumulated PDF,
43 which is then used to change the distribution from unifrom to
50 \*---------------------------------------------------------------------------*/
55 #include "IOdictionary.H"
59 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
66 /*---------------------------------------------------------------------------*\
68 \*---------------------------------------------------------------------------*/
77 //- Coefficients dictionary
78 const dictionary pdfDict_;
80 //- Reference to the randmo number generator
84 // Protected Member Functions
86 //- Check that the PDF is valid
87 virtual void check() const;
92 //-Runtime type information
96 //- Declare runtime constructor selection table
97 declareRunTimeSelectionTable
103 const dictionary& dict,
112 //- Construct from dictionary
113 pdf(const word& name, const dictionary& dict, Random& rndGen);
117 static autoPtr<pdf> New(const dictionary& dict, Random& rndGen);
127 virtual scalar sample() const = 0;
129 //- Return the minimum value
130 virtual scalar minValue() const = 0;
132 //- Return the maximum value
133 virtual scalar maxValue() const = 0;
137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 } // End namespace pdfs
140 } // End namespace Foam
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 // ************************************************************************* //