exponential.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2016 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::distributionModels::exponential
28 
29 Description
30  exponential distribution model
31 
32 SourceFiles
33  exponential.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef distributionModels_exponential_H
38 #define distributionModels_exponential_H
39 
40 #include "distributionModel.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 namespace distributionModels
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class exponential Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 class exponential
54 :
55  public distributionModel
56 {
57  // Private data
58 
59  //- Distribution minimum
60  scalar minValue_;
61 
62  //- Distribution maximum
63  scalar maxValue_;
64 
65 
66  // Model coefficients
67 
68  scalar lambda_;
69 
70 
71 public:
72 
73  //- Runtime type information
74  TypeName("exponential");
75 
76 
77  // Constructors
78 
79  //- Construct from components
81 
82  //- Construct copy
83  exponential(const exponential& p);
84 
85  //- Construct and return a clone
86  virtual autoPtr<distributionModel> clone() const
87  {
88  return autoPtr<distributionModel>(new exponential(*this));
89  }
90 
91 
92  //- Destructor
93  virtual ~exponential();
94 
95 
96  // Member Functions
97 
98  //- Sample the distributionModel
99  virtual scalar sample() const;
100 
101  //- Return the minimum value
102  virtual scalar minValue() const;
103 
104  //- Return the maximum value
105  virtual scalar maxValue() const;
106 
107  //- Return the mean value
108  virtual scalar meanValue() const;
109 };
110 
111 
112 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
113 
114 } // End namespace distributionModels
115 } // End namespace Foam
116 
117 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
118 
119 #endif
120 
121 // ************************************************************************* //
Foam::Random
Random number generator.
Definition: Random.H:59
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::distributionModels::exponential::sample
virtual scalar sample() const
Sample the distributionModel.
Definition: exponential.C:76
Foam::distributionModels::exponential::~exponential
virtual ~exponential()
Destructor.
Definition: exponential.C:70
Foam::distributionModels::exponential::exponential
exponential(const dictionary &dict, Random &rndGen)
Construct from components.
Definition: exponential.C:45
Foam::distributionModel
A library of runtime-selectable distribution models.
Definition: distributionModel.H:70
Foam::distributionModels::exponential::minValue
virtual scalar minValue() const
Return the minimum value.
Definition: exponential.C:84
Foam::distributionModels::exponential::clone
virtual autoPtr< distributionModel > clone() const
Construct and return a clone.
Definition: exponential.H:85
Foam::distributionModels::exponential::TypeName
TypeName("exponential")
Runtime type information.
Foam::distributionModels::exponential::maxValue
virtual scalar maxValue() const
Return the maximum value.
Definition: exponential.C:90
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::distributionModels::exponential::meanValue
virtual scalar meanValue() const
Return the mean value.
Definition: exponential.C:96
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
rndGen
Random rndGen
Definition: createFields.H:23
Foam::distributionModels::exponential
exponential distribution model
Definition: exponential.H:52
distributionModel.H