OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

normal.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software; you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM; if not, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Class
00026     Foam::normal
00027 
00028 Description
00029     A normal pdf
00030 
00031     @verbatim
00032         pdf = strength * exp(-0.5*((x - expectation)/variance)^2 )
00033     @endverbatim
00034 
00035     strength only has meaning if there's more than one pdf
00036 
00037 SourceFiles
00038     normalI.H
00039     normal.C
00040     normalIO.C
00041 
00042 \*---------------------------------------------------------------------------*/
00043 
00044 #ifndef normal_H
00045 #define normal_H
00046 
00047 #include "pdf.H"
00048 
00049 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00050 
00051 namespace Foam
00052 {
00053 
00054 /*---------------------------------------------------------------------------*\
00055                            Class normal Declaration
00056 \*---------------------------------------------------------------------------*/
00057 
00058 class normal
00059 :
00060     public pdf
00061 {
00062     // Private data
00063 
00064         dictionary pdfDict_;
00065 
00066         //- min and max values of the distribution
00067         scalar minValue_;
00068         scalar maxValue_;
00069 
00070         List<scalar> expectation_;
00071         List<scalar> variance_;
00072         List<scalar> strength_;
00073 
00074         scalar range_;
00075 
00076 
00077 public:
00078 
00079     //- Runtime type information
00080     TypeName("normal");
00081 
00082 
00083     // Constructors
00084 
00085         //- Construct from components
00086         normal
00087         (
00088             const dictionary& dict,
00089             Random& rndGen
00090         );
00091 
00092 
00093     //- Destructor
00094     virtual ~normal();
00095 
00096 
00097     // Member Functions
00098 
00099         //- Sample the pdf
00100         virtual scalar sample() const;
00101 
00102         //- Return the minimum value
00103         virtual scalar minValue() const;
00104 
00105         //- Return the maximum value
00106         virtual scalar maxValue() const;
00107 };
00108 
00109 
00110 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00111 
00112 } // End namespace Foam
00113 
00114 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00115 
00116 #endif
00117 
00118 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd