initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / thermophysicalModels / pdfs / normal / normal.H
blob1bb9dc80a89f053e70f10e8d6732707d40c03249
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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 the
13     Free Software Foundation; either version 2 of the License, or (at your
14     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
19     for more details.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Class
26     Foam::normal
28 Description
29     A normal pdf
31     @verbatim
32         pdf = strength * exp(-0.5*((x - expectation)/variance)^2 )
33     @endverbatim
35     strength only has meaning if there's more than one pdf
37 SourceFiles
38     normalI.H
39     normal.C
40     normalIO.C
42 \*---------------------------------------------------------------------------*/
44 #ifndef normal_H
45 #define normal_H
47 #include "pdf.H"
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 namespace Foam
54 /*---------------------------------------------------------------------------*\
55                            Class normal Declaration
56 \*---------------------------------------------------------------------------*/
58 class normal
60     public pdf
62     // Private data
64         dictionary pdfDict_;
66         //- min and max values of the distribution
67         scalar minValue_;
68         scalar maxValue_;
70         List<scalar> expectation_;
71         List<scalar> variance_;
72         List<scalar> strength_;
74         scalar range_;
77 public:
79     //- Runtime type information
80     TypeName("normal");
83     // Constructors
85         //- Construct from components
86         normal
87         (
88             const dictionary& dict,
89             Random& rndGen
90         );
93     //- Destructor
94     virtual ~normal();
97     // Member Functions
99         //- Sample the pdf
100         virtual scalar sample() const;
102         //- Return the minimum value
103         virtual scalar minValue() const;
105         //- Return the maximum value
106         virtual scalar maxValue() const;
110 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
112 } // End namespace Foam
114 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
116 #endif
118 // ************************************************************************* //