Merge branch 'master' of ssh://git.code.sf.net/p/foam-extend/foam-extend-3.2
[foam-extend-3.2.git] / src / thermophysicalModels / pdfs / pdf / pdf.H
blob3d32109a2713a2d566cadcc22993657ac7979362
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | foam-extend: Open Source CFD
4    \\    /   O peration     | Version:     3.2
5     \\  /    A nd           | Web:         http://www.foam-extend.org
6      \\/     M anipulation  | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
8 License
9     This file is part of foam-extend.
11     foam-extend is free software: you can redistribute it and/or modify it
12     under the terms of the GNU General Public License as published by the
13     Free Software Foundation, either version 3 of the License, or (at your
14     option) any later version.
16     foam-extend is distributed in the hope that it will be useful, but
17     WITHOUT ANY WARRANTY; without even the implied warranty of
18     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19     General Public License for more details.
21     You should have received a copy of the GNU General Public License
22     along with foam-extend.  If not, see <http://www.gnu.org/licenses/>.
24 Class
25     Foam::pdf
27 Description
28     A library of runtime-selectable pdf's.
30     Returns a sampled value given the expectation (nu) and variance (sigma^2)
32     Sample of planned pdfs (beta p. 374-375):
33     - binomial
34     - geometric
35     - Poisson
36     - hypergeometric
37     - Pascal
38     - uniform
39     - exponential
40     - normal
41     - Gamma
42     - chi
43     - t?
44     - F?
45     - beta
46     - Weibull
47     - Rayleigh
48     - Cauchy?
50     The pdf is tabulated in equidistant nPoints, in an interval.
51     These values are integrated to obtain the cumulated pdf,
52     which is then used to change the distribution from unifrom to
53     the actual pdf.
55 SourceFiles
56     pdfI.H
57     pdf.C
58     pdfIO.C
60 \*---------------------------------------------------------------------------*/
62 #ifndef pdf_H
63 #define pdf_H
65 #include "IOdictionary.H"
66 #include "autoPtr.H"
67 #include "Random.H"
69 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
71 namespace Foam
74 /*---------------------------------------------------------------------------*\
75                            Class pdf Declaration
76 \*---------------------------------------------------------------------------*/
78 class pdf
81 protected:
83     // Protected data
85         const dictionary& dict_;
87         Random& rndGen_;
90 public:
92     //-Runtime type information
93     TypeName("pdf");
96     //- Declare runtime constructor selection table
97     declareRunTimeSelectionTable
98     (
99         autoPtr,
100         pdf,
101         dictionary,
102         (
103             const dictionary& dict,
104             Random& rndGen
105         ),
106         (dict, rndGen)
107     );
110     // Constructors
112         //- Construct from dictionary
113         pdf(const dictionary& dict, Random& rndGen);
116     //- Selector
117     static autoPtr<pdf> New(const dictionary& dict, Random& rndGen);
120     //- Destructor
121     virtual ~pdf();
124     // Member Functions
126         //- Sample the pdf
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 Foam
141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143 #endif
145 // ************************************************************************* //