Loading...
Searching...
No Matches
uniform.C
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 Copyright (C) 2021 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27\*---------------------------------------------------------------------------*/
28
29#include "uniform.H"
32// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
33
34namespace Foam
35{
36namespace distributionModels
37{
40}
41}
42
43// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
44
46(
47 const dictionary& dict,
49)
54}
55
56
60{}
61
62
63// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
66{
67 return rndGen_.position<scalar>(minValue_, maxValue_);
68}
69
70
72{
73 return 0.5*(minValue_ + maxValue_);
74}
75
76
77// ************************************************************************* //
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
Random number generator.
Definition Random.H:56
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
A library of runtime-selectable doubly-truncated probability distribution models. Returns random samp...
virtual void check() const
Check that the distribution model is valid.
Random & rndGen_
Reference to the random number generator.
scalar minValue_
Minimum of the distribution.
scalar maxValue_
Maximum of the distribution.
distributionModel(const word &name, const dictionary &dict, Random &rndGen)
Construct from dictionary.
Particle-size distribution model wherein random samples are drawn from the doubly-truncated uniform p...
Definition uniform.H:160
virtual scalar meanValue() const
Return the theoretical mean of the distribution.
Definition uniform.C:64
virtual scalar sample() const
Sample the distribution.
Definition uniform.C:58
uniform(const dictionary &dict, Random &rndGen)
Construct from components.
Definition uniform.C:39
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Definition className.H:142
volScalarField & p
A namespace for various probability distribution model implementations.
Definition binned.C:29
Namespace for OpenFOAM.
const word GlobalIOList< Tuple2< scalar, vector > >::typeName("scalarVectorTable")
dictionary dict
Random rndGen