|
|
|
pdf.HGo 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-2007 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 pdf 00027 00028 Description 00029 00030 A library of runtime selectable pdf's. 00031 Returns a sampled value given the expectation (nu) and variance (sigma^2) 00032 00033 sample of planned pdfs (beta p. 374-375) 00034 00035 binomial 00036 geometric 00037 Poisson 00038 hypergeometric 00039 Pascal 00040 uniform 00041 exponential 00042 normal 00043 Gamma 00044 chi 00045 t? 00046 F? 00047 beta 00048 Weibull 00049 Rayleigh 00050 Cauchy? 00051 00052 The pdf is tabulated in equidistant nPoints, in an interval. 00053 These values are integrated to obtain the cumulated pdf, 00054 which is then used to change the distribution from unifrom to 00055 the actual pdf. 00056 00057 SourceFiles 00058 pdfI.H 00059 pdf.C 00060 pdfIO.C 00061 00062 \*---------------------------------------------------------------------------*/ 00063 00064 #ifndef pdf_H 00065 #define pdf_H 00066 00067 #include "IOdictionary.H" 00068 #include "autoPtr.H" 00069 #include "Random.H" 00070 00071 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00072 00073 namespace Foam 00074 { 00075 00076 /*---------------------------------------------------------------------------*\ 00077 Class pdf Declaration 00078 \*---------------------------------------------------------------------------*/ 00079 00080 class pdf 00081 { 00082 00083 protected: 00084 00085 // Protected data 00086 00087 const dictionary& dict_; 00088 00089 Random& rndGen_; 00090 00091 00092 public: 00093 00094 //-Runtime type information 00095 TypeName("pdf"); 00096 00097 // Declare runtime constructor selection table 00098 00099 declareRunTimeSelectionTable 00100 ( 00101 autoPtr, 00102 pdf, 00103 dictionary, 00104 ( 00105 const dictionary& dict, 00106 Random& rndGen 00107 ), 00108 (dict, rndGen) 00109 ); 00110 00111 00112 // Constructors 00113 00114 //- Construct from dictionary 00115 pdf 00116 ( 00117 const dictionary& dict, 00118 Random& rndGen 00119 ); 00120 00121 // Selectors 00122 00123 static autoPtr<pdf> New 00124 ( 00125 const dictionary& dict, 00126 Random& rndGen 00127 ); 00128 00129 00130 // Destructor 00131 00132 virtual ~pdf(); 00133 00134 00135 // Member Functions 00136 00137 //- Sample the pdf 00138 virtual scalar sample() const = 0; 00139 00140 virtual scalar minValue() const = 0; 00141 virtual scalar maxValue() const = 0; 00142 }; 00143 00144 00145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00146 00147 } // End namespace Foam 00148 00149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00150 00151 //#include "pdfI.H" 00152 00153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00154 00155 #endif 00156 00157 // ************************************************************************* // |