Forward compatibility: flex
[foam-extend-3.2.git] / src / thermophysicalModels / pdfs / normal / normal.H
blob15028947ee34fd260566b85971507efffa25f90f
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::normal
27 Description
28     A normal pdf
30     @verbatim
31         pdf = strength * exp(-0.5*((x - expectation)/variance)^2 )
32     @endverbatim
34     strength only has meaning if there's more than one pdf
36 SourceFiles
37     normalI.H
38     normal.C
39     normalIO.C
41 \*---------------------------------------------------------------------------*/
43 #ifndef normal_H
44 #define normal_H
46 #include "pdf.H"
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 namespace Foam
53 /*---------------------------------------------------------------------------*\
54                            Class normal Declaration
55 \*---------------------------------------------------------------------------*/
57 class normal
59     public pdf
61     // Private data
63         dictionary pdfDict_;
65         //- min and max values of the distribution
66         scalar minValue_;
67         scalar maxValue_;
69         List<scalar> expectation_;
70         List<scalar> variance_;
71         List<scalar> strength_;
73         scalar range_;
76 public:
78     //- Runtime type information
79     TypeName("normal");
82     // Constructors
84         //- Construct from components
85         normal
86         (
87             const dictionary& dict,
88             Random& rndGen
89         );
92     //- Destructor
93     virtual ~normal();
96     // Member Functions
98         //- Sample the pdf
99         virtual scalar sample() const;
101         //- Return the minimum value
102         virtual scalar minValue() const;
104         //- Return the maximum value
105         virtual scalar maxValue() const;
109 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
111 } // End namespace Foam
113 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
115 #endif
117 // ************************************************************************* //