uniform.H 3.1 KB
Newer Older
1 2 3 4
/*---------------------------------------------------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     |
OpenFOAM bot's avatar
OpenFOAM bot committed
5
    \\  /    A nd           | www.openfoam.com
6
     \\/     M anipulation  |
OpenFOAM bot's avatar
OpenFOAM bot committed
7
-------------------------------------------------------------------------------
OpenFOAM bot's avatar
OpenFOAM bot committed
8
    Copyright (C) 2011-2016 OpenFOAM Foundation
9 10 11 12
-------------------------------------------------------------------------------
License
    This file is part of OpenFOAM.

13 14 15 16
    OpenFOAM is free software: you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.
17 18 19 20 21 22 23

    OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    for more details.

    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::uniform
28 29

Description
30
    Uniform/equally-weighted distribution model
31 32 33 34 35 36

SourceFiles
    uniform.C

\*---------------------------------------------------------------------------*/

37 38
#ifndef distributionModels_uniform_H
#define distributionModels_uniform_H
39

40
#include "distributionModel.H"
41 42 43 44 45

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

namespace Foam
{
46
namespace distributionModels
47
{
48 49 50 51 52 53 54

/*---------------------------------------------------------------------------*\
                           Class uniform Declaration
\*---------------------------------------------------------------------------*/

class uniform
:
55
    public distributionModel
56 57 58
{
    // Private data

59
        //- Distribution minimum
60
        scalar minValue_;
61 62

        //- Distribution maximum
63 64 65 66 67 68
        scalar maxValue_;


public:

    //- Runtime type information
Andrew Heather's avatar
Andrew Heather committed
69
    TypeName("uniform");
70 71 72 73 74


    // Constructors

        //- Construct from components
75
        uniform(const dictionary& dict, Random& rndGen);
76 77 78 79 80

        //- Construct copy
        uniform(const uniform& p);

        //- Construct and return a clone
81
        virtual autoPtr<distributionModel> clone() const
82
        {
83
            return autoPtr<distributionModel>(new uniform(*this));
84
        }
85 86


Andrew Heather's avatar
Andrew Heather committed
87 88
    //- Destructor
    virtual ~uniform();
89 90 91 92


    // Member Functions

93
        //- Sample the distributionModel
Andrew Heather's avatar
Andrew Heather committed
94
        virtual scalar sample() const;
95

Andrew Heather's avatar
Andrew Heather committed
96 97
        //- Return the minimum value
        virtual scalar minValue() const;
98

Andrew Heather's avatar
Andrew Heather committed
99 100
        //- Return the maximum value
        virtual scalar maxValue() const;
andy's avatar
andy committed
101 102 103

        //- Return the mean value
        virtual scalar meanValue() const;
104 105 106 107 108
};


// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

109
} // End namespace distributionModels
110 111 112 113 114 115 116
} // End namespace Foam

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

#endif

// ************************************************************************* //