distributionModel.C 2.75 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-2017 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 27

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

28
#include "distributionModel.H"
29 30

// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
Andrew Heather's avatar
Andrew Heather committed
31

32 33
namespace Foam
{
34 35
    defineTypeNameAndDebug(distributionModel, 0);
    defineRunTimeSelectionTable(distributionModel, dictionary);
Andrew Heather's avatar
Andrew Heather committed
36
}
37

38

39 40
// * * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * //

41
void Foam::distributionModel::check() const
42 43 44
{
    if (minValue() < 0)
    {
45
        FatalErrorInFunction
46 47
            << type() << "distribution: Minimum value must be greater than "
            << "zero." << nl << "Supplied minValue = " << minValue()
48 49 50 51 52
            << abort(FatalError);
    }

    if (maxValue() < minValue())
    {
53
        FatalErrorInFunction
54 55
            << type() << "distribution: Maximum value is smaller than the "
            << "minimum value:" << nl << "    maxValue = " << maxValue()
56 57 58 59 60 61
            << ", minValue = " << minValue()
            << abort(FatalError);
    }
}


62 63
// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //

64
Foam::distributionModel::distributionModel
65 66 67
(
    const word& name,
    const dictionary& dict,
68
    Random& rndGen
69
)
70
:
71
    distributionModelDict_(dict),
72 73 74 75
    rndGen_(rndGen)
{}


76
Foam::distributionModel::distributionModel
77 78 79
(
    const distributionModel& p
)
80
:
81
    distributionModelDict_(p.distributionModelDict_),
82 83 84 85
    rndGen_(p.rndGen_)
{}


86 87
// * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //

88
Foam::distributionModel::~distributionModel()
89 90 91 92
{}


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