unintegrableForNonZeroQ.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2023-2024 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
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.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::distributions::unintegrableForNonZeroQ
26 
27 Description
28  Base class for distributions that have a closed integral form for the
29  cumulative density function (CDF) when the effective size exponent is zero,
30  but not otherwise.
31 
32 SourceFiles
33  unintegrableForNonZeroQ.C
34 
35 See also
36  Foam::distribution
37 
38 \*---------------------------------------------------------------------------*/
39 
40 #ifndef unintegrableForNonZeroQ_H
41 #define unintegrableForNonZeroQ_H
42 
43 #include "unintegrable.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 namespace distributions
50 {
51 
52 /*---------------------------------------------------------------------------*\
53  Class unintegrableForNonZeroQ Declaration
54 \*---------------------------------------------------------------------------*/
55 
57 :
58  public unintegrable
59 {
60 protected:
61 
62  // Protected Member Functions
63 
64  //- Return values of the un-normalised CDF for the given size exponent
65  // and x-coordinates.
66  virtual tmp<scalarField> Phi
67  (
68  const label q,
69  const scalarField& x
70  ) const;
71 
72  //- Return values of the un-normalised CDF for zero effective size
73  // exponent and given x-coordinates
74  virtual tmp<scalarField> PhiForZeroQ(const scalarField& x) const = 0;
75 
76  //- Return values of the un-normalised CDF at the minimum and maximum
77  // x-coordinates for the given size exponent.
78  virtual Pair<scalar> Phi01(const label q) const;
79 
80  //- Access cached values of the un-normalised CDF at the minimum and
81  // maximum x-coordinates.
82  using unintegrable::Phi01;
83 
84 
85 public:
86 
87  // Constructors
88 
89  //- Inherit constructors
91 
92 
93  // Member Functions
94 
95  //- Sample the distribution
96  virtual scalar sample() const;
97 
98  //- Sample the distribution
99  virtual scalar sampleForZeroQ() const = 0;
100 
101  //- Return the integral of the PDF multiplied by an integer power of x
103  (
104  const scalarField& x,
105  const label e,
106  const bool consistent = false
107  ) const;
108 };
109 
110 
111 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
112 
113 } // End namespace distributions
114 } // End namespace Foam
115 
116 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
117 
118 #endif
119 
120 // ************************************************************************* //
label q() const
Return the effective distribution size exponent.
Definition: distribution.H:107
Base class for distributions that have a closed integral form for the cumulative density function (CD...
virtual tmp< scalarField > Phi(const label q, const scalarField &x) const
Return values of the un-normalised CDF for the given size exponent.
virtual tmp< scalarField > integralPDFxPow(const scalarField &x, const label e, const bool consistent=false) const
Return the integral of the PDF multiplied by an integer power of x.
virtual scalar sample() const
Sample the distribution.
virtual Pair< scalar > Phi01(const label q) const
Access cached values of the un-normalised CDF at the minimum and.
Definition: unintegrable.C:330
virtual tmp< scalarField > PhiForZeroQ(const scalarField &x) const =0
Return values of the un-normalised CDF for zero effective size.
virtual scalar sampleForZeroQ() const =0
Sample the distribution.
Base class for distributions that do not have a closed integral form for the cumulative density funct...
Definition: unintegrable.H:58
unintegrable(const word &name, const unitConversion &units, const dictionary &dict, const label sampleQ, randomGenerator &&rndGen)
Construct from a dictionary.
Definition: unintegrable.C:353
const Pair< scalar > & Phi01() const
Access cached values of the un-normalised CDF at the minimum and.
Definition: unintegrable.C:340
A class for managing temporary objects.
Definition: tmp.H:55
Namespace for OpenFOAM.
const doubleScalar e
Definition: doubleScalar.H:106
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59