randomGenerator: Renamed Random
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -58,7 +58,7 @@ namespace Foam
|
||||
{
|
||||
|
||||
// Forward declaration of classes
|
||||
class Random;
|
||||
class randomGenerator;
|
||||
|
||||
namespace fv
|
||||
{
|
||||
@ -111,7 +111,7 @@ protected:
|
||||
typedef typename CloudType::parcelType parcelType;
|
||||
|
||||
//- Reference to the cloud random number generator
|
||||
Random& rndGen_;
|
||||
randomGenerator& rndGen_;
|
||||
|
||||
|
||||
// Film models
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -70,7 +70,7 @@ SourceFiles
|
||||
|
||||
#include "ejectionModel.H"
|
||||
#include "distribution.H"
|
||||
#include "Random.H"
|
||||
#include "randomGenerator.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -97,7 +97,7 @@ class dripping
|
||||
scalar minParticlesPerParcel_;
|
||||
|
||||
//- Random number generator
|
||||
Random rndGen_;
|
||||
randomGenerator rndGen_;
|
||||
|
||||
//- Parcel size PDF model
|
||||
const autoPtr<distribution> parcelDistribution_;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -32,7 +32,7 @@ Description
|
||||
#include "List.H"
|
||||
#include "BinSum.H"
|
||||
#include "IOstreams.H"
|
||||
#include "Random.H"
|
||||
#include "randomGenerator.H"
|
||||
#include "scalarField.H"
|
||||
|
||||
using namespace Foam;
|
||||
@ -41,7 +41,7 @@ using namespace Foam;
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
Random rndGen(0);
|
||||
randomGenerator rndGen(0);
|
||||
|
||||
scalarField samples(10000000);
|
||||
forAll(samples, i)
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -31,7 +31,7 @@ Description
|
||||
|
||||
#include "IStringStream.H"
|
||||
#include "Polynomial.H"
|
||||
#include "Random.H"
|
||||
#include "randomGenerator.H"
|
||||
#include "cpuTime.H"
|
||||
|
||||
using namespace Foam;
|
||||
@ -136,10 +136,10 @@ int main(int argc, char *argv[])
|
||||
polyCopy = 2.5*poly;
|
||||
Info<< "2.5*poly = " << polyCopy << nl << endl;
|
||||
|
||||
Random rnd(123456);
|
||||
randomGenerator rndGen(123456);
|
||||
for (int i=0; i<10; i++)
|
||||
{
|
||||
scalar x = rnd.scalar01()*100;
|
||||
scalar x = rndGen.scalar01()*100;
|
||||
|
||||
scalar px = polyValue(x);
|
||||
scalar ipx = intPolyValue(x);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2022 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2022-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -75,7 +75,7 @@ int main(int argc, char *argv[])
|
||||
cpuTime time;
|
||||
for (label testi = 0; testi < nTests; ++ testi)
|
||||
{
|
||||
Random rndGen(seed + testi);
|
||||
randomGenerator rndGen(seed + testi);
|
||||
|
||||
// Get random points
|
||||
ps.resize(nPs);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2023 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2023-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -60,7 +60,7 @@ int main(int argc, char *argv[])
|
||||
static const label nSamples = 10000000;
|
||||
|
||||
// Initialise the random number generator
|
||||
Random rndGen(clock::getTime());
|
||||
randomGenerator rndGen(clock::getTime());
|
||||
|
||||
// Create a zero-size-exponent, zero-sampling-size-exponent distribution
|
||||
// from which to get X-coordinates
|
||||
|
||||
@ -41,7 +41,7 @@ Description
|
||||
#include "polyTopoChange.H"
|
||||
#include "fvcDiv.H"
|
||||
#include "zeroGradientFvPatchFields.H"
|
||||
#include "Random.H"
|
||||
#include "randomGenerator.H"
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
@ -63,7 +63,7 @@ int main(int argc, char *argv[])
|
||||
timeSelector::select0(runTime, args);
|
||||
#include "createMesh.H"
|
||||
|
||||
Random rndGen(0);
|
||||
randomGenerator rndGen(0);
|
||||
|
||||
// Test mapping
|
||||
// ------------
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#include "cpuTime.H"
|
||||
#include "Pair.H"
|
||||
#include "Random.H"
|
||||
#include "randomGenerator.H"
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
@ -17,7 +17,7 @@ static const label E = 4;
|
||||
template<class Pow>
|
||||
Pair<scalar> run(Pow pow)
|
||||
{
|
||||
Random rndGen(0);
|
||||
randomGenerator rndGen(0);
|
||||
|
||||
cpuTime time;
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2012-2022 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -37,7 +37,7 @@ Description
|
||||
#include "OPstream.H"
|
||||
#include "vector.H"
|
||||
#include "IOstreams.H"
|
||||
#include "Random.H"
|
||||
#include "randomGenerator.H"
|
||||
#include "Tuple2.H"
|
||||
#include "PstreamBuffers.H"
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -37,7 +37,7 @@ Description
|
||||
#include "OPstream.H"
|
||||
#include "vector.H"
|
||||
#include "IOstreams.H"
|
||||
#include "Random.H"
|
||||
#include "randomGenerator.H"
|
||||
#include "Tuple2.H"
|
||||
|
||||
using namespace Foam;
|
||||
@ -56,7 +56,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (true)
|
||||
{
|
||||
Random rndGen(43544*Pstream::myProcNo());
|
||||
randomGenerator rndGen(43544*Pstream::myProcNo());
|
||||
|
||||
// Generate random data.
|
||||
List<Tuple2<label, List<scalar>>> complexData(100);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2021-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -76,7 +76,7 @@ int main(int argc, char *argv[])
|
||||
Info<< "Seeding random number generator with value " << seed
|
||||
<< nl << endl;
|
||||
}
|
||||
Random rndGen(seed);
|
||||
randomGenerator rndGen(seed);
|
||||
|
||||
// Get controls
|
||||
const bool simple = args.optionFound("simple");
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#include "primitiveFields.H"
|
||||
#include "Random.H"
|
||||
#include "randomGenerator.H"
|
||||
#include "cpuTime.H"
|
||||
#include "IOstreams.H"
|
||||
#include "OFstream.H"
|
||||
@ -15,7 +15,7 @@ int main()
|
||||
const label rndAddrSkip = 40;
|
||||
const label redFac = 6;
|
||||
const label redSize = size/redFac;
|
||||
Random genAddr(100);
|
||||
randomGenerator rndGen(100);
|
||||
|
||||
double* f1 = new double[size];
|
||||
double* f2 = new double[size];
|
||||
@ -38,7 +38,7 @@ int main()
|
||||
|
||||
for (label i=0; i<size; i+=rndAddrSkip)
|
||||
{
|
||||
addr[i] = genAddr.sampleAB<label>(0, size);
|
||||
addr[i] = rndGen.sampleAB<label>(0, size);
|
||||
}
|
||||
|
||||
for (label i=0; i<redSize; i++)
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -33,14 +33,14 @@ Description
|
||||
#include "argList.H"
|
||||
#include "polyMesh.H"
|
||||
#include "Time.H"
|
||||
#include "Random.H"
|
||||
#include "randomGenerator.H"
|
||||
#include "PackedList.H"
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
void testPackedList(const polyMesh& mesh, Random& rndGen)
|
||||
void testPackedList(const polyMesh& mesh, randomGenerator& rndGen)
|
||||
{
|
||||
Info<< nl << "Testing PackedList synchronisation." << endl;
|
||||
|
||||
@ -182,7 +182,7 @@ void testPackedList(const polyMesh& mesh, Random& rndGen)
|
||||
}
|
||||
|
||||
|
||||
void testSparseData(const polyMesh& mesh, Random& rndGen)
|
||||
void testSparseData(const polyMesh& mesh, randomGenerator& rndGen)
|
||||
{
|
||||
Info<< nl << "Testing Map synchronisation." << endl;
|
||||
|
||||
@ -372,7 +372,7 @@ void testSparseData(const polyMesh& mesh, Random& rndGen)
|
||||
}
|
||||
|
||||
|
||||
void testPointSync(const polyMesh& mesh, Random& rndGen)
|
||||
void testPointSync(const polyMesh& mesh, randomGenerator& rndGen)
|
||||
{
|
||||
Info<< nl << "Testing point-wise data synchronisation." << endl;
|
||||
|
||||
@ -440,7 +440,7 @@ void testPointSync(const polyMesh& mesh, Random& rndGen)
|
||||
}
|
||||
|
||||
|
||||
void testEdgeSync(const polyMesh& mesh, Random& rndGen)
|
||||
void testEdgeSync(const polyMesh& mesh, randomGenerator& rndGen)
|
||||
{
|
||||
Info<< nl << "Testing edge-wise data synchronisation." << endl;
|
||||
|
||||
@ -517,7 +517,7 @@ void testEdgeSync(const polyMesh& mesh, Random& rndGen)
|
||||
}
|
||||
|
||||
|
||||
void testFaceSync(const polyMesh& mesh, Random& rndGen)
|
||||
void testFaceSync(const polyMesh& mesh, randomGenerator& rndGen)
|
||||
{
|
||||
Info<< nl << "Testing face-wise data synchronisation." << endl;
|
||||
|
||||
@ -593,7 +593,7 @@ int main(int argc, char *argv[])
|
||||
#include "createPolyMesh.H"
|
||||
|
||||
|
||||
Random rndGen(5341*(Pstream::myProcNo()+1));
|
||||
randomGenerator rndGen(5341*(Pstream::myProcNo()+1));
|
||||
|
||||
|
||||
// Face sync
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
|
||||
mkDir(pdfPath);
|
||||
|
||||
Random rndGen(label(0));
|
||||
randomGenerator rndGen(label(0));
|
||||
|
||||
autoPtr<distribution> p
|
||||
(
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
Random rndGen(653213);
|
||||
randomGenerator rndGen(653213);
|
||||
|
||||
// Determine mesh bounding boxes:
|
||||
List<treeBoundBox> meshBb
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2014-2023 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2014-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -168,7 +168,7 @@ void createBoundaryEdgeTrees
|
||||
+ surf.nInternalEdges()
|
||||
);
|
||||
|
||||
Random rndGen(17301893);
|
||||
randomGenerator rndGen(17301893);
|
||||
|
||||
// Slightly extended bb. Slightly off-centred just so on symmetric
|
||||
// geometry there are less face/edge aligned items.
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -36,7 +36,7 @@ Description
|
||||
#include "triSurface.H"
|
||||
#include "OFstream.H"
|
||||
#include "meshTools.H"
|
||||
#include "Random.H"
|
||||
#include "randomGenerator.H"
|
||||
#include "transform.H"
|
||||
#include "IOmanip.H"
|
||||
#include "Pair.H"
|
||||
@ -114,7 +114,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
label pertI = 0;
|
||||
|
||||
Random rand(57373);
|
||||
randomGenerator rndGen(57373);
|
||||
|
||||
while ((magSqr(eVal) < vSmall) && pertI < 10)
|
||||
{
|
||||
@ -122,9 +122,9 @@ int main(int argc, char *argv[])
|
||||
<< "No eigenValues found, shape may have symmetry, "
|
||||
<< "perturbing inertia tensor diagonal" << endl;
|
||||
|
||||
J.xx() *= 1.0 + small*rand.scalar01();
|
||||
J.yy() *= 1.0 + small*rand.scalar01();
|
||||
J.zz() *= 1.0 + small*rand.scalar01();
|
||||
J.xx() *= 1.0 + small*rndGen.scalar01();
|
||||
J.yy() *= 1.0 + small*rndGen.scalar01();
|
||||
J.zz() *= 1.0 + small*rndGen.scalar01();
|
||||
|
||||
eVal = eigenValues(J);
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -40,7 +40,7 @@ Description
|
||||
#include "boundBox.H"
|
||||
#include "indexedOctree.H"
|
||||
#include "treeDataTriSurface.H"
|
||||
#include "Random.H"
|
||||
#include "randomGenerator.H"
|
||||
#include "volumeType.H"
|
||||
#include "plane.H"
|
||||
|
||||
|
||||
@ -136,7 +136,7 @@ sha1 = primitives/hashes/SHA1
|
||||
$(sha1)/SHA1.C
|
||||
$(sha1)/SHA1Digest.C
|
||||
|
||||
primitives/Random/Random.C
|
||||
primitives/randomGenerator/randomGenerator.C
|
||||
|
||||
ranges = primitives/ranges
|
||||
$(ranges)/labelRange/labelRange.C
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2022 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2022-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -34,7 +34,7 @@ SourceFiles
|
||||
#define boundSphere_H
|
||||
|
||||
#include "point.H"
|
||||
#include "Random.H"
|
||||
#include "randomGenerator.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -78,7 +78,11 @@ Tuple2<point, scalar> weizlBoundSphere
|
||||
//- Compute a bounding sphere for an arbitrary number of points, and given an
|
||||
// engine with which to randomise Weizl's algorithm
|
||||
template<class PointField>
|
||||
Tuple2<point, scalar> boundSphere(const PointField& ps, Random& rndGen);
|
||||
Tuple2<point, scalar> boundSphere
|
||||
(
|
||||
const PointField& ps,
|
||||
randomGenerator& rndGen
|
||||
);
|
||||
|
||||
//- Compute a bounding sphere for an arbitrary number of points
|
||||
template<class PointField>
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2022-2023 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2022-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -254,7 +254,7 @@ Foam::Tuple2<Foam::point, Foam::scalar> Foam::weizlBoundSphere
|
||||
|
||||
template<class PointField>
|
||||
Foam::Tuple2<Foam::point, Foam::scalar>
|
||||
Foam::boundSphere(const PointField& ps, Random& rndGen)
|
||||
Foam::boundSphere(const PointField& ps, randomGenerator& rndGen)
|
||||
{
|
||||
if (ps.size() <= 4)
|
||||
{
|
||||
@ -283,7 +283,7 @@ Foam::boundSphere(const PointField& ps)
|
||||
else
|
||||
{
|
||||
labelList pis(identityMap(ps.size()));
|
||||
Random(0).permute(pis);
|
||||
randomGenerator(0).permute(pis);
|
||||
FixedList<label, 4> boundaryPis({-1, -1, -1, -1});
|
||||
return weizlBoundSphere(ps, pis, ps.size(), boundaryPis, 0);
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2021-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -186,7 +186,7 @@ bool Foam::polygonTriangulate::ear
|
||||
|
||||
Foam::List<Foam::point> Foam::polygonTriangulate::randomPolygon
|
||||
(
|
||||
Random& rndGen,
|
||||
randomGenerator& rndGen,
|
||||
const label n,
|
||||
const scalar error
|
||||
)
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2021 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2021-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -237,7 +237,7 @@ public:
|
||||
//- Generate a random polygon for testing purposes
|
||||
static List<point> randomPolygon
|
||||
(
|
||||
Random& rndGen,
|
||||
randomGenerator& rndGen,
|
||||
const label n,
|
||||
const scalar error
|
||||
);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -74,7 +74,7 @@ Foam::tmp<Foam::scalarField> Foam::distributions::RosinRammler::Phi
|
||||
Foam::distributions::RosinRammler::RosinRammler
|
||||
(
|
||||
const dictionary& dict,
|
||||
Random& rndGen,
|
||||
randomGenerator& rndGen,
|
||||
const label sampleQ
|
||||
)
|
||||
:
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -125,7 +125,7 @@ public:
|
||||
RosinRammler
|
||||
(
|
||||
const dictionary& dict,
|
||||
Random& rndGen,
|
||||
randomGenerator& rndGen,
|
||||
const label sampleQ
|
||||
);
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -77,7 +77,7 @@ Foam::distribution::distribution
|
||||
(
|
||||
const word& name,
|
||||
const dictionary& dict,
|
||||
Random& rndGen,
|
||||
randomGenerator& rndGen,
|
||||
const label sampleQ
|
||||
)
|
||||
:
|
||||
@ -103,7 +103,7 @@ Foam::distribution::distribution
|
||||
|
||||
Foam::distribution::distribution
|
||||
(
|
||||
Random& rndGen,
|
||||
randomGenerator& rndGen,
|
||||
const label Q,
|
||||
const label sampleQ
|
||||
)
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -60,7 +60,7 @@ SourceFiles
|
||||
#define distribution_H
|
||||
|
||||
#include "dictionary.H"
|
||||
#include "Random.H"
|
||||
#include "randomGenerator.H"
|
||||
#include "scalarField.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -79,7 +79,7 @@ protected:
|
||||
// Protected data
|
||||
|
||||
//- Reference to a random number generator
|
||||
Random& rndGen_;
|
||||
randomGenerator& rndGen_;
|
||||
|
||||
//- Distribution size exponent
|
||||
const label Q_;
|
||||
@ -124,7 +124,7 @@ public:
|
||||
dictionary,
|
||||
(
|
||||
const dictionary& dict,
|
||||
Random& rndGen,
|
||||
randomGenerator& rndGen,
|
||||
const label sampleQ
|
||||
),
|
||||
(dict, rndGen, sampleQ)
|
||||
@ -138,12 +138,17 @@ public:
|
||||
(
|
||||
const word& name,
|
||||
const dictionary& dict,
|
||||
Random& rndGen,
|
||||
randomGenerator& rndGen,
|
||||
const label sampleQ
|
||||
);
|
||||
|
||||
//- Construct from components
|
||||
distribution(Random& rndGen, const label Q, const label sampleQ);
|
||||
distribution
|
||||
(
|
||||
randomGenerator& rndGen,
|
||||
const label Q,
|
||||
const label sampleQ
|
||||
);
|
||||
|
||||
//- Construct copy
|
||||
distribution(const distribution& d, const label sampleQ);
|
||||
@ -162,7 +167,7 @@ public:
|
||||
static autoPtr<distribution> New
|
||||
(
|
||||
const dictionary& dict,
|
||||
Random& rndGen,
|
||||
randomGenerator& rndGen,
|
||||
const label sampleQ
|
||||
);
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -30,7 +30,7 @@ License
|
||||
Foam::autoPtr<Foam::distribution> Foam::distribution::New
|
||||
(
|
||||
const dictionary& dict,
|
||||
Random& rndGen,
|
||||
randomGenerator& rndGen,
|
||||
const label sampleQ
|
||||
)
|
||||
{
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -72,7 +72,7 @@ Foam::tmp<Foam::scalarField> Foam::distributions::exponential::Phi
|
||||
Foam::distributions::exponential::exponential
|
||||
(
|
||||
const dictionary& dict,
|
||||
Random& rndGen,
|
||||
randomGenerator& rndGen,
|
||||
const label sampleQ
|
||||
)
|
||||
:
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -115,7 +115,7 @@ public:
|
||||
exponential
|
||||
(
|
||||
const dictionary& dict,
|
||||
Random& rndGen,
|
||||
randomGenerator& rndGen,
|
||||
const label sampleQ
|
||||
);
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -43,7 +43,7 @@ namespace distributions
|
||||
Foam::distributions::fixedValue::fixedValue
|
||||
(
|
||||
const dictionary& dict,
|
||||
Random& rndGen,
|
||||
randomGenerator& rndGen,
|
||||
const label
|
||||
)
|
||||
:
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -82,7 +82,7 @@ public:
|
||||
fixedValue
|
||||
(
|
||||
const dictionary& dict,
|
||||
Random& rndGen,
|
||||
randomGenerator& rndGen,
|
||||
const label sampleQ
|
||||
);
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -113,7 +113,7 @@ Foam::tmp<Foam::scalarField> Foam::distributions::multiNormal::Phi
|
||||
Foam::distributions::multiNormal::multiNormal
|
||||
(
|
||||
const dictionary& dict,
|
||||
Random& rndGen,
|
||||
randomGenerator& rndGen,
|
||||
const label sampleQ
|
||||
)
|
||||
:
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -119,7 +119,7 @@ public:
|
||||
multiNormal
|
||||
(
|
||||
const dictionary& dict,
|
||||
Random& rndGen,
|
||||
randomGenerator& rndGen,
|
||||
const label sampleQ
|
||||
);
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -108,7 +108,7 @@ Foam::scalar Foam::distributions::normal::sampleForZeroQ(const scalar s) const
|
||||
Foam::distributions::normal::normal
|
||||
(
|
||||
const dictionary& dict,
|
||||
Random& rndGen,
|
||||
randomGenerator& rndGen,
|
||||
const label sampleQ
|
||||
)
|
||||
:
|
||||
@ -133,7 +133,7 @@ Foam::distributions::normal::normal
|
||||
|
||||
Foam::distributions::normal::normal
|
||||
(
|
||||
Random& rndGen,
|
||||
randomGenerator& rndGen,
|
||||
const label Q,
|
||||
const label sampleQ,
|
||||
const label n,
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -136,14 +136,14 @@ public:
|
||||
normal
|
||||
(
|
||||
const dictionary& dict,
|
||||
Random& rndGen,
|
||||
randomGenerator& rndGen,
|
||||
const label sampleQ
|
||||
);
|
||||
|
||||
//- Construct from components
|
||||
normal
|
||||
(
|
||||
Random& rndGen,
|
||||
randomGenerator& rndGen,
|
||||
const label Q,
|
||||
const label sampleQ,
|
||||
const label n,
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -45,7 +45,7 @@ namespace distributions
|
||||
Foam::distributions::tabulatedCumulative::tabulatedCumulative
|
||||
(
|
||||
const dictionary& dict,
|
||||
Random& rndGen,
|
||||
randomGenerator& rndGen,
|
||||
const label sampleQ
|
||||
)
|
||||
:
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -103,7 +103,7 @@ public:
|
||||
tabulatedCumulative
|
||||
(
|
||||
const dictionary& dict,
|
||||
Random& rndGen,
|
||||
randomGenerator& rndGen,
|
||||
const label sampleQ
|
||||
);
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -45,7 +45,7 @@ namespace distributions
|
||||
Foam::distributions::tabulatedDensity::tabulatedDensity
|
||||
(
|
||||
const dictionary& dict,
|
||||
Random& rndGen,
|
||||
randomGenerator& rndGen,
|
||||
const label sampleQ
|
||||
)
|
||||
:
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -104,7 +104,7 @@ public:
|
||||
tabulatedDensity
|
||||
(
|
||||
const dictionary& dict,
|
||||
Random& rndGen,
|
||||
randomGenerator& rndGen,
|
||||
const label sampleQ
|
||||
);
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -58,7 +58,7 @@ Foam::scalar Foam::distributions::uniform::Phi(const scalar x) const
|
||||
Foam::distributions::uniform::uniform
|
||||
(
|
||||
const dictionary& dict,
|
||||
Random& rndGen,
|
||||
randomGenerator& rndGen,
|
||||
const label sampleQ
|
||||
)
|
||||
:
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -97,7 +97,12 @@ public:
|
||||
// Constructors
|
||||
|
||||
//- Construct from a dictionary
|
||||
uniform(const dictionary& dict, Random& rndGen, const label sampleQ);
|
||||
uniform
|
||||
(
|
||||
const dictionary& dict,
|
||||
randomGenerator& rndGen,
|
||||
const label sampleQ
|
||||
);
|
||||
|
||||
//- Construct copy
|
||||
uniform(const uniform& d, const label sampleQ);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2023 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2023-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -306,7 +306,7 @@ Foam::distributions::unintegrable::unintegrable
|
||||
(
|
||||
const word& name,
|
||||
const dictionary& dict,
|
||||
Random& rndGen,
|
||||
randomGenerator& rndGen,
|
||||
const label sampleQ
|
||||
)
|
||||
:
|
||||
@ -317,7 +317,7 @@ Foam::distributions::unintegrable::unintegrable
|
||||
|
||||
Foam::distributions::unintegrable::unintegrable
|
||||
(
|
||||
Random& rndGen,
|
||||
randomGenerator& rndGen,
|
||||
const label Q,
|
||||
const label sampleQ,
|
||||
const label n
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2023 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2023-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -188,14 +188,14 @@ public:
|
||||
(
|
||||
const word& name,
|
||||
const dictionary& dict,
|
||||
Random& rndGen,
|
||||
randomGenerator& rndGen,
|
||||
const label sampleQ
|
||||
);
|
||||
|
||||
//- Construct from components
|
||||
unintegrable
|
||||
(
|
||||
Random& rndGen,
|
||||
randomGenerator& rndGen,
|
||||
const label Q,
|
||||
const label sampleQ,
|
||||
const label n
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2013-2019 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2013-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -26,7 +26,7 @@ License
|
||||
#include "procFacesGAMGProcAgglomeration.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "GAMGAgglomeration.H"
|
||||
#include "Random.H"
|
||||
#include "randomGenerator.H"
|
||||
#include "lduMesh.H"
|
||||
#include "processorLduInterface.H"
|
||||
#include "processorGAMGInterface.H"
|
||||
@ -253,7 +253,7 @@ bool Foam::procFacesGAMGProcAgglomeration::agglomerate()
|
||||
|
||||
if (agglom_.size() >= 1)
|
||||
{
|
||||
Random rndGen(0);
|
||||
randomGenerator rndGen(0);
|
||||
|
||||
for
|
||||
(
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -41,7 +41,7 @@ SourceFiles
|
||||
#include "point.H"
|
||||
#include "primitiveFieldsFwd.H"
|
||||
#include "pointHit.H"
|
||||
#include "Random.H"
|
||||
#include "randomGenerator.H"
|
||||
#include "FixedList.H"
|
||||
#include "UList.H"
|
||||
#include "triPointRef.H"
|
||||
@ -162,7 +162,7 @@ public:
|
||||
|
||||
//- Return a random point in the tetrahedron from a
|
||||
// uniform distribution
|
||||
inline Point randomPoint(Random& rndGen) const;
|
||||
inline Point randomPoint(randomGenerator& rndGen) const;
|
||||
|
||||
//- Calculate the point from the given barycentric coordinates.
|
||||
inline Point barycentricToPoint(const barycentric& bary) const;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -216,7 +216,7 @@ inline Foam::scalar Foam::tetrahedron<Point, PointRef>::quality() const
|
||||
template<class Point, class PointRef>
|
||||
inline Point Foam::tetrahedron<Point, PointRef>::randomPoint
|
||||
(
|
||||
Random& rndGen
|
||||
randomGenerator& rndGen
|
||||
) const
|
||||
{
|
||||
return barycentricToPoint(barycentric01(rndGen));
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -39,7 +39,7 @@ SourceFiles
|
||||
#include "vector.H"
|
||||
#include "tensor.H"
|
||||
#include "pointHit.H"
|
||||
#include "Random.H"
|
||||
#include "randomGenerator.H"
|
||||
#include "FixedList.H"
|
||||
#include "UList.H"
|
||||
#include "linePointRef.H"
|
||||
@ -161,7 +161,7 @@ public:
|
||||
|
||||
//- Return a random point on the triangle from a uniform
|
||||
// distribution
|
||||
inline Point randomPoint(Random& rndGen) const;
|
||||
inline Point randomPoint(randomGenerator& rndGen) const;
|
||||
|
||||
//- Calculate the point from the given barycentric coordinates.
|
||||
inline Point barycentricToPoint(const barycentric2D& bary) const;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -213,7 +213,10 @@ inline Foam::tensor Foam::triangle<Point, PointRef>::inertia
|
||||
|
||||
|
||||
template<class Point, class PointRef>
|
||||
inline Point Foam::triangle<Point, PointRef>::randomPoint(Random& rndGen) const
|
||||
inline Point Foam::triangle<Point, PointRef>::randomPoint
|
||||
(
|
||||
randomGenerator& rndGen
|
||||
) const
|
||||
{
|
||||
return barycentricToPoint(barycentric2D01(rndGen));
|
||||
}
|
||||
|
||||
@ -67,7 +67,7 @@ SourceFiles
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
class Random;
|
||||
class randomGenerator;
|
||||
|
||||
|
||||
// Forward declaration of friend functions and operators
|
||||
|
||||
@ -24,7 +24,7 @@ License
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "treeBoundBox.H"
|
||||
#include "Random.H"
|
||||
#include "randomGenerator.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2017-2018 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2017-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -24,11 +24,11 @@ License
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "barycentric.H"
|
||||
#include "Random.H"
|
||||
#include "randomGenerator.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::barycentric Foam::barycentric01(Random& rndGen)
|
||||
Foam::barycentric Foam::barycentric01(randomGenerator& rndGen)
|
||||
{
|
||||
scalar s = rndGen.scalar01();
|
||||
scalar t = rndGen.scalar01();
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2016-2018 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2016-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -42,7 +42,7 @@ namespace Foam
|
||||
{
|
||||
|
||||
// Forward declaration of classes
|
||||
class Random;
|
||||
class randomGenerator;
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -51,7 +51,7 @@ typedef Barycentric<scalar> barycentric;
|
||||
|
||||
|
||||
//- Generate a random barycentric coordinate within the unit tetrahedron
|
||||
barycentric barycentric01(Random& rndGen);
|
||||
barycentric barycentric01(randomGenerator& rndGen);
|
||||
|
||||
|
||||
template<>
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2017-2018 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2017-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -24,11 +24,11 @@ License
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "barycentric2D.H"
|
||||
#include "Random.H"
|
||||
#include "randomGenerator.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::barycentric2D Foam::barycentric2D01(Random& rndGen)
|
||||
Foam::barycentric2D Foam::barycentric2D01(randomGenerator& rndGen)
|
||||
{
|
||||
scalar s = rndGen.scalar01();
|
||||
scalar t = rndGen.scalar01();
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2017-2018 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2017-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -42,7 +42,7 @@ namespace Foam
|
||||
{
|
||||
|
||||
// Forward declaration of classes
|
||||
class Random;
|
||||
class randomGenerator;
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -51,7 +51,7 @@ typedef Barycentric2D<scalar> barycentric2D;
|
||||
|
||||
|
||||
//- Generate a random barycentric coordinate within the unit triangle
|
||||
barycentric2D barycentric2D01(Random& rndGen);
|
||||
barycentric2D barycentric2D01(randomGenerator& rndGen);
|
||||
|
||||
|
||||
template<>
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2018 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2018-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -23,12 +23,12 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "Random.H"
|
||||
#include "randomGenerator.H"
|
||||
#include "PstreamReduceOps.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::scalar Foam::Random::scalarNormal()
|
||||
Foam::scalar Foam::randomGenerator::scalarNormal()
|
||||
{
|
||||
// Proper inversion of the distribution. Slow. Exactly maintains
|
||||
// the random behaviour of the generator.
|
||||
@ -91,7 +91,7 @@ Foam::scalar Foam::Random::scalarNormal()
|
||||
}
|
||||
|
||||
|
||||
Foam::scalar Foam::Random::globalScalar01()
|
||||
Foam::scalar Foam::randomGenerator::globalScalar01()
|
||||
{
|
||||
scalar value = - vGreat;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2018-2022 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2018-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -22,7 +22,7 @@ License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::Random
|
||||
Foam::randomGenerator
|
||||
|
||||
Description
|
||||
Random number generator
|
||||
@ -37,12 +37,13 @@ Description
|
||||
details of the seeding and iteration sequence.
|
||||
|
||||
SourceFiles
|
||||
RandomI.H
|
||||
randomGenerator.C
|
||||
randomGeneratorI.H
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef Random_H
|
||||
#define Random_H
|
||||
#ifndef randomGenerator_H
|
||||
#define randomGenerator_H
|
||||
|
||||
#include "scalar.H"
|
||||
|
||||
@ -52,10 +53,10 @@ namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class Random Declaration
|
||||
Class randomGenerator Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class Random
|
||||
class randomGenerator
|
||||
{
|
||||
// Private Typedefs
|
||||
|
||||
@ -92,11 +93,11 @@ public:
|
||||
// Constructors
|
||||
|
||||
//- Construct from a seed
|
||||
inline Random(const label s);
|
||||
inline randomGenerator(const label s);
|
||||
|
||||
|
||||
//- Destructor
|
||||
inline ~Random();
|
||||
inline ~randomGenerator();
|
||||
|
||||
|
||||
// Member Functions
|
||||
@ -150,19 +151,19 @@ public:
|
||||
|
||||
|
||||
template<>
|
||||
inline scalar Random::sample01();
|
||||
inline scalar randomGenerator::sample01();
|
||||
|
||||
template<>
|
||||
inline label Random::sample01();
|
||||
inline label randomGenerator::sample01();
|
||||
|
||||
template<>
|
||||
inline scalar Random::sampleAB(const scalar& a, const scalar& b);
|
||||
inline scalar randomGenerator::sampleAB(const scalar& a, const scalar& b);
|
||||
|
||||
template<>
|
||||
inline label Random::sampleAB(const label& a, const label& b);
|
||||
inline label randomGenerator::sampleAB(const label& a, const label& b);
|
||||
|
||||
template<>
|
||||
inline scalar Random::sampleNormal();
|
||||
inline scalar randomGenerator::sampleNormal();
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -171,7 +172,7 @@ inline scalar Random::sampleNormal();
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "RandomI.H"
|
||||
#include "randomGeneratorI.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2018-2022 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2018-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -23,11 +23,11 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "Random.H"
|
||||
#include "randomGenerator.H"
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
inline Foam::Random::type Foam::Random::sample()
|
||||
inline Foam::randomGenerator::type Foam::randomGenerator::sample()
|
||||
{
|
||||
x_ = (A*x_ + C) % M;
|
||||
|
||||
@ -37,7 +37,7 @@ inline Foam::Random::type Foam::Random::sample()
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
inline Foam::Random::Random(const label s)
|
||||
inline Foam::randomGenerator::randomGenerator(const label s)
|
||||
:
|
||||
x_((type(s) << 16) + 0x330E),
|
||||
scalarNormalStored_(false),
|
||||
@ -47,26 +47,30 @@ inline Foam::Random::Random(const label s)
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
inline Foam::Random::~Random()
|
||||
inline Foam::randomGenerator::~randomGenerator()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
inline Foam::scalar Foam::Random::scalar01()
|
||||
inline Foam::scalar Foam::randomGenerator::scalar01()
|
||||
{
|
||||
return scalar(sample())/(M >> 17);
|
||||
}
|
||||
|
||||
|
||||
inline Foam::scalar Foam::Random::scalarAB(const scalar a, const scalar b)
|
||||
inline Foam::scalar Foam::randomGenerator::scalarAB
|
||||
(
|
||||
const scalar a,
|
||||
const scalar b
|
||||
)
|
||||
{
|
||||
return a + scalar01()*(b - a);
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
inline Type Foam::Random::sample01()
|
||||
inline Type Foam::randomGenerator::sample01()
|
||||
{
|
||||
Type value;
|
||||
|
||||
@ -80,42 +84,50 @@ inline Type Foam::Random::sample01()
|
||||
|
||||
|
||||
template<>
|
||||
inline Foam::scalar Foam::Random::sample01()
|
||||
inline Foam::scalar Foam::randomGenerator::sample01()
|
||||
{
|
||||
return scalar01();
|
||||
}
|
||||
|
||||
|
||||
template<>
|
||||
inline Foam::label Foam::Random::sample01()
|
||||
inline Foam::label Foam::randomGenerator::sample01()
|
||||
{
|
||||
return sample() % 2;
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
inline Type Foam::Random::sampleAB(const Type& a, const Type& b)
|
||||
inline Type Foam::randomGenerator::sampleAB(const Type& a, const Type& b)
|
||||
{
|
||||
return a + cmptMultiply(sample01<Type>(), b - a);
|
||||
}
|
||||
|
||||
|
||||
template<>
|
||||
inline Foam::scalar Foam::Random::sampleAB(const scalar& a, const scalar& b)
|
||||
inline Foam::scalar Foam::randomGenerator::sampleAB
|
||||
(
|
||||
const scalar& a,
|
||||
const scalar& b
|
||||
)
|
||||
{
|
||||
return scalarAB(a, b);
|
||||
}
|
||||
|
||||
|
||||
template<>
|
||||
inline Foam::label Foam::Random::sampleAB(const label& a, const label& b)
|
||||
inline Foam::label Foam::randomGenerator::sampleAB
|
||||
(
|
||||
const label& a,
|
||||
const label& b
|
||||
)
|
||||
{
|
||||
return a + sample() % (b - a);
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
inline Type Foam::Random::sampleNormal()
|
||||
inline Type Foam::randomGenerator::sampleNormal()
|
||||
{
|
||||
Type value;
|
||||
|
||||
@ -129,14 +141,14 @@ inline Type Foam::Random::sampleNormal()
|
||||
|
||||
|
||||
template<>
|
||||
inline Foam::scalar Foam::Random::sampleNormal()
|
||||
inline Foam::scalar Foam::randomGenerator::sampleNormal()
|
||||
{
|
||||
return scalarNormal();
|
||||
}
|
||||
|
||||
|
||||
template<class Container>
|
||||
inline void Foam::Random::permute(Container& l)
|
||||
inline void Foam::randomGenerator::permute(Container& l)
|
||||
{
|
||||
for (label i = 0; i < l.size(); ++ i)
|
||||
{
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -73,7 +73,7 @@ SourceFiles
|
||||
#ifndef turbulentInletFvPatchField_H
|
||||
#define turbulentInletFvPatchField_H
|
||||
|
||||
#include "Random.H"
|
||||
#include "randomGenerator.H"
|
||||
#include "fixedValueFvPatchFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -93,7 +93,7 @@ class turbulentInletFvPatchField
|
||||
// Private Data
|
||||
|
||||
//- Random number generator
|
||||
Random ranGen_;
|
||||
randomGenerator ranGen_;
|
||||
|
||||
//- Fluctuation scale
|
||||
Type fluctuationScale_;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2016-2022 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2016-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -24,7 +24,7 @@ License
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "volFields.H"
|
||||
#include "Random.H"
|
||||
#include "randomGenerator.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
@ -38,11 +38,11 @@ bool Foam::functionObjects::randomise::calcRandomised()
|
||||
tmp<VolField<Type>> rfieldt(new VolField<Type>(field));
|
||||
VolField<Type>& rfield = rfieldt.ref();
|
||||
|
||||
Random rand(1234567);
|
||||
randomGenerator rndGen(1234567);
|
||||
|
||||
forAll(field, celli)
|
||||
{
|
||||
Type rndPert = rand.sample01<Type>();
|
||||
Type rndPert = rndGen.sample01<Type>();
|
||||
rndPert = 2.0*rndPert - pTraits<Type>::one;
|
||||
rndPert /= mag(rndPert);
|
||||
rfield[celli] += magPerturbation_*rndPert;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -35,7 +35,7 @@ SourceFiles
|
||||
#ifndef cellMotionFvPatchField_H
|
||||
#define cellMotionFvPatchField_H
|
||||
|
||||
#include "Random.H"
|
||||
#include "randomGenerator.H"
|
||||
#include "fixedValueFvPatchFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -39,7 +39,7 @@ SourceFiles
|
||||
#include "Cloud.H"
|
||||
#include "IOdictionary.H"
|
||||
#include "autoPtr.H"
|
||||
#include "Random.H"
|
||||
#include "randomGenerator.H"
|
||||
#include "fvMesh.H"
|
||||
#include "volFields.H"
|
||||
#include "scalarIOField.H"
|
||||
@ -141,7 +141,7 @@ class DSMCCloud
|
||||
List<typename ParcelType::constantProperties> constProps_;
|
||||
|
||||
//- Random number generator
|
||||
Random rndGen_;
|
||||
randomGenerator rndGen_;
|
||||
|
||||
|
||||
// boundary value fields
|
||||
@ -268,7 +268,7 @@ public:
|
||||
constProps(label typeId) const;
|
||||
|
||||
//- Return references to the random object
|
||||
inline Random& rndGen();
|
||||
inline randomGenerator& rndGen();
|
||||
|
||||
|
||||
// References to the boundary fields for surface data collection
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -118,7 +118,7 @@ Foam::DSMCCloud<ParcelType>::constProps
|
||||
|
||||
|
||||
template<class ParcelType>
|
||||
inline Foam::Random& Foam::DSMCCloud<ParcelType>::rndGen()
|
||||
inline Foam::randomGenerator& Foam::DSMCCloud<ParcelType>::rndGen()
|
||||
{
|
||||
return rndGen_;
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -39,7 +39,7 @@ Foam::scalar Foam::LarsenBorgnakkeVariableHardSphere<CloudType>::energyRatio
|
||||
{
|
||||
CloudType& cloud(this->owner());
|
||||
|
||||
Random& rndGen(cloud.rndGen());
|
||||
randomGenerator& rndGen(cloud.rndGen());
|
||||
|
||||
scalar ChiAMinusOne = ChiA - 1;
|
||||
scalar ChiBMinusOne = ChiB - 1;
|
||||
@ -179,7 +179,7 @@ void Foam::LarsenBorgnakkeVariableHardSphere<CloudType>::collide
|
||||
scalar& EiP = pP.Ei();
|
||||
scalar& EiQ = pQ.Ei();
|
||||
|
||||
Random& rndGen(cloud.rndGen());
|
||||
randomGenerator& rndGen(cloud.rndGen());
|
||||
|
||||
scalar inverseCollisionNumber = 1/relaxationCollisionNumber_;
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -114,7 +114,7 @@ void Foam::VariableHardSphere<CloudType>::collide
|
||||
vector& UP = pP.U();
|
||||
vector& UQ = pQ.U();
|
||||
|
||||
Random& rndGen(cloud.rndGen());
|
||||
randomGenerator& rndGen(cloud.rndGen());
|
||||
|
||||
scalar mP = cloud.constProps(typeIdP).mass();
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -145,7 +145,7 @@ void Foam::FreeStream<CloudType>::inflow()
|
||||
|
||||
const scalar deltaT = mesh.time().deltaTValue();
|
||||
|
||||
Random& rndGen(cloud.rndGen());
|
||||
randomGenerator& rndGen(cloud.rndGen());
|
||||
|
||||
scalar sqrtPi = sqrt(pi);
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -80,7 +80,7 @@ void Foam::MaxwellianThermal<CloudType>::correct
|
||||
|
||||
CloudType& cloud(this->owner());
|
||||
|
||||
Random& rndGen(cloud.rndGen());
|
||||
randomGenerator& rndGen(cloud.rndGen());
|
||||
|
||||
while (mag(Ut) < small)
|
||||
{
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -78,7 +78,7 @@ void Foam::MixedDiffuseSpecular<CloudType>::correct
|
||||
|
||||
CloudType& cloud(this->owner());
|
||||
|
||||
Random& rndGen(cloud.rndGen());
|
||||
randomGenerator& rndGen(cloud.rndGen());
|
||||
|
||||
if (diffuseFraction_ > rndGen.scalar01())
|
||||
{
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -25,7 +25,7 @@ License
|
||||
|
||||
#include "moleculeCloud.H"
|
||||
#include "molecule.H"
|
||||
#include "Random.H"
|
||||
#include "randomGenerator.H"
|
||||
#include "Time.H"
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -42,7 +42,7 @@ SourceFiles
|
||||
#include "potential.H"
|
||||
#include "InteractionLists.H"
|
||||
#include "labelVector.H"
|
||||
#include "Random.H"
|
||||
#include "randomGenerator.H"
|
||||
#include "fileName.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -70,7 +70,7 @@ class moleculeCloud
|
||||
|
||||
List<molecule::constantProperties> constPropList_;
|
||||
|
||||
Random rndGen_;
|
||||
randomGenerator rndGen_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
@ -191,7 +191,7 @@ public:
|
||||
inline const molecule::constantProperties&
|
||||
constProps(label id) const;
|
||||
|
||||
inline Random& rndGen();
|
||||
inline randomGenerator& rndGen();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -378,7 +378,7 @@ inline const Foam::molecule::constantProperties&
|
||||
}
|
||||
|
||||
|
||||
inline Foam::Random& Foam::moleculeCloud::rndGen()
|
||||
inline Foam::randomGenerator& Foam::moleculeCloud::rndGen()
|
||||
{
|
||||
return rndGen_;
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -55,7 +55,7 @@ SourceFiles
|
||||
#include "Cloud.H"
|
||||
#include "timeIOdictionary.H"
|
||||
#include "autoPtr.H"
|
||||
#include "Random.H"
|
||||
#include "randomGenerator.H"
|
||||
#include "fvMesh.H"
|
||||
#include "volFields.H"
|
||||
#include "fvMatrices.H"
|
||||
@ -156,7 +156,7 @@ protected:
|
||||
const dictionary subModelProperties_;
|
||||
|
||||
//- Random number generator - used by some injection routines
|
||||
mutable Random rndGen_;
|
||||
mutable randomGenerator rndGen_;
|
||||
|
||||
//- Cell occupancy information for each parcel, (demand driven)
|
||||
autoPtr<List<DynamicList<parcelType*>>> cellOccupancyPtr_;
|
||||
@ -365,7 +365,7 @@ public:
|
||||
// Cloud data
|
||||
|
||||
//- Return reference to the random object
|
||||
inline Random& rndGen() const;
|
||||
inline randomGenerator& rndGen() const;
|
||||
|
||||
//- Return the cell occupancy information for each
|
||||
// parcel, non-const access, the caller is
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -360,7 +360,7 @@ inline Foam::scalar Foam::MomentumCloud<CloudType>::Dmax() const
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
inline Foam::Random& Foam::MomentumCloud<CloudType>::rndGen() const
|
||||
inline Foam::randomGenerator& Foam::MomentumCloud<CloudType>::rndGen() const
|
||||
{
|
||||
return rndGen_;
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2012-2023 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -27,7 +27,7 @@ License
|
||||
#include "Pstream.H"
|
||||
#include "surfaceWriter.H"
|
||||
#include "unitConversion.H"
|
||||
#include "Random.H"
|
||||
#include "randomGenerator.H"
|
||||
#include "triangle.H"
|
||||
#include "cloud.H"
|
||||
#include "axesRotation.H"
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2013-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -71,7 +71,7 @@ Foam::scalar Foam::IsotropyModels::Stochastic<CloudType>::sampleGauss()
|
||||
}
|
||||
else
|
||||
{
|
||||
Random& rndGen = this->owner().rndGen();
|
||||
randomGenerator& rndGen = this->owner().rndGen();
|
||||
|
||||
scalar f, m, x, y;
|
||||
|
||||
@ -98,7 +98,7 @@ void Foam::IsotropyModels::Stochastic<CloudType>::calculate()
|
||||
{
|
||||
const fvMesh& mesh = this->owner().mesh();
|
||||
const scalar deltaT(this->owner().db().time().deltaTValue());
|
||||
Random& rndGen = this->owner().rndGen();
|
||||
randomGenerator& rndGen = this->owner().rndGen();
|
||||
|
||||
const scalar oneBySqrtThree = sqrt(1.0/3.0);
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -100,7 +100,7 @@ Foam::vector Foam::GradientDispersionRAS<CloudType>::update
|
||||
scalar& tTurb
|
||||
)
|
||||
{
|
||||
Random& rnd = this->owner().rndGen();
|
||||
randomGenerator& rndGen = this->owner().rndGen();
|
||||
|
||||
const scalar cps = 0.16432;
|
||||
|
||||
@ -135,11 +135,11 @@ Foam::vector Foam::GradientDispersionRAS<CloudType>::update
|
||||
// prevent this we let fac be both negative/positive
|
||||
if (this->owner().mesh().nSolutionD() == 2)
|
||||
{
|
||||
fac = rnd.scalarNormal();
|
||||
fac = rndGen.scalarNormal();
|
||||
}
|
||||
else
|
||||
{
|
||||
fac = mag(rnd.scalarNormal());
|
||||
fac = mag(rndGen.scalarNormal());
|
||||
}
|
||||
|
||||
UTurb = sigma*fac*dir;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -71,7 +71,7 @@ Foam::vector Foam::StochasticDispersionRAS<CloudType>::update
|
||||
scalar& tTurb
|
||||
)
|
||||
{
|
||||
Random& rnd = this->owner().rndGen();
|
||||
randomGenerator& rndGen = this->owner().rndGen();
|
||||
|
||||
const scalar cps = 0.16432;
|
||||
|
||||
@ -99,13 +99,13 @@ Foam::vector Foam::StochasticDispersionRAS<CloudType>::update
|
||||
// Calculate a random direction dir distributed uniformly
|
||||
// in spherical coordinates
|
||||
|
||||
const scalar theta = rnd.scalar01()*twoPi;
|
||||
const scalar u = 2*rnd.scalar01() - 1;
|
||||
const scalar theta = rndGen.scalar01()*twoPi;
|
||||
const scalar u = 2*rndGen.scalar01() - 1;
|
||||
|
||||
const scalar a = sqrt(1 - sqr(u));
|
||||
const vector dir(a*cos(theta), a*sin(theta), u);
|
||||
|
||||
UTurb = sigma*mag(rnd.scalarNormal())*dir;
|
||||
UTurb = sigma*mag(rndGen.scalarNormal())*dir;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@ -39,7 +39,7 @@ void Foam::CellZoneInjection<CloudType>::setPositions
|
||||
{
|
||||
const fvMesh& mesh = this->owner().mesh();
|
||||
|
||||
Random& rnd = this->owner().rndGen();
|
||||
randomGenerator& rndGen = this->owner().rndGen();
|
||||
|
||||
const label nCells = cellZoneCells.size();
|
||||
DynamicList<barycentric> injectorCoordinates(nCells);
|
||||
@ -85,7 +85,7 @@ void Foam::CellZoneInjection<CloudType>::setPositions
|
||||
// Set new particle position and cellId
|
||||
for (label pI = 0; pI < addParticles; pI++)
|
||||
{
|
||||
const scalar volFrac = rnd.sample01<scalar>();
|
||||
const scalar volFrac = rndGen.sample01<scalar>();
|
||||
label tetI = 0;
|
||||
forAll(cTetVFrac, vfI)
|
||||
{
|
||||
@ -96,7 +96,7 @@ void Foam::CellZoneInjection<CloudType>::setPositions
|
||||
}
|
||||
}
|
||||
|
||||
injectorCoordinates.append(barycentric01(rnd));
|
||||
injectorCoordinates.append(barycentric01(rndGen));
|
||||
injectorCells.append(celli);
|
||||
injectorTetFaces.append(cellTetIs[tetI].face());
|
||||
injectorTetPts.append(cellTetIs[tetI].tetPt());
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -340,7 +340,7 @@ void Foam::ConeInjection<CloudType>::setPositionAndCell
|
||||
label& facei
|
||||
)
|
||||
{
|
||||
Random& rndGen = this->owner().rndGen();
|
||||
randomGenerator& rndGen = this->owner().rndGen();
|
||||
|
||||
const scalar t = time - this->SOI_;
|
||||
|
||||
@ -411,7 +411,7 @@ void Foam::ConeInjection<CloudType>::setProperties
|
||||
{
|
||||
const polyMesh& mesh = this->owner().mesh();
|
||||
|
||||
Random& rndGen = this->owner().rndGen();
|
||||
randomGenerator& rndGen = this->owner().rndGen();
|
||||
|
||||
const scalar t = time - this->SOI_;
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -179,8 +179,8 @@ void Foam::MomentumLookupTableInjection<CloudType>::setPositionAndCell
|
||||
label injectorI = 0;
|
||||
if (randomise_)
|
||||
{
|
||||
Random& rnd = this->owner().rndGen();
|
||||
injectorI = rnd.sampleAB<label>(0, injectorCells_.size());
|
||||
randomGenerator& rndGen = this->owner().rndGen();
|
||||
injectorI = rndGen.sampleAB<label>(0, injectorCells_.size());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -154,7 +154,7 @@ Foam::label Foam::PatchFlowRateInjection<CloudType>::nParcelsToInject
|
||||
|
||||
scalar nParcels = parcelConcentration_*c*flowRate()*dt;
|
||||
|
||||
Random& rnd = this->owner().rndGen();
|
||||
randomGenerator& rndGen = this->owner().rndGen();
|
||||
|
||||
label nParcelsToInject = floor(nParcels);
|
||||
|
||||
@ -163,7 +163,7 @@ Foam::label Foam::PatchFlowRateInjection<CloudType>::nParcelsToInject
|
||||
if
|
||||
(
|
||||
nParcelsToInject > 0
|
||||
&& nParcels - scalar(nParcelsToInject) > rnd.globalScalar01()
|
||||
&& nParcels - scalar(nParcelsToInject) > rndGen.globalScalar01()
|
||||
)
|
||||
{
|
||||
++nParcelsToInject;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -172,7 +172,7 @@ Foam::label Foam::PatchInjection<CloudType>::nParcelsToInject
|
||||
{
|
||||
scalar nParcels = parcelsPerSecond_->integral(time0, time1);
|
||||
|
||||
Random& rnd = this->owner().rndGen();
|
||||
randomGenerator& rndGen = this->owner().rndGen();
|
||||
|
||||
label nParcelsToInject = floor(nParcels);
|
||||
|
||||
@ -181,7 +181,7 @@ Foam::label Foam::PatchInjection<CloudType>::nParcelsToInject
|
||||
if
|
||||
(
|
||||
nParcelsToInject > 0
|
||||
&& (nParcels - scalar(nParcelsToInject) > rnd.globalScalar01())
|
||||
&& (nParcels - scalar(nParcelsToInject) > rndGen.globalScalar01())
|
||||
)
|
||||
{
|
||||
++nParcelsToInject;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2013-2023 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2013-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -26,7 +26,7 @@ License
|
||||
#include "patchInjectionBase.H"
|
||||
#include "polyMesh.H"
|
||||
#include "SubField.H"
|
||||
#include "Random.H"
|
||||
#include "randomGenerator.H"
|
||||
#include "triPointRef.H"
|
||||
#include "volFields.H"
|
||||
#include "polyMeshTetDecomposition.H"
|
||||
@ -132,7 +132,7 @@ void Foam::patchInjectionBase::topoChange(const polyMesh& mesh)
|
||||
void Foam::patchInjectionBase::setPositionAndCell
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
Random& rnd,
|
||||
randomGenerator& rndGen,
|
||||
barycentric& coordinates,
|
||||
label& celli,
|
||||
label& tetFacei,
|
||||
@ -161,7 +161,7 @@ void Foam::patchInjectionBase::setPositionAndCell
|
||||
|
||||
const polyPatch& patch = mesh.boundaryMesh()[patchId_];
|
||||
|
||||
scalar area = rnd.globalScalar01()*sumProcArea_.last();
|
||||
scalar area = rndGen.globalScalar01()*sumProcArea_.last();
|
||||
|
||||
if (patch.size() > 0)
|
||||
{
|
||||
@ -179,7 +179,7 @@ void Foam::patchInjectionBase::setPositionAndCell
|
||||
findArea(sumFaceTriArea_[patchFacei], area);
|
||||
|
||||
// Set the topology
|
||||
const barycentric2D r = barycentric2D01(rnd);
|
||||
const barycentric2D r = barycentric2D01(rndGen);
|
||||
coordinates = barycentric(0, r.a(), r.b(), r.c());
|
||||
celli = mesh.faceOwner()[patch.start() + patchFacei];
|
||||
tetFacei = patch.start() + patchFacei;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2013-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -56,7 +56,7 @@ namespace Foam
|
||||
// Forward class declarations
|
||||
class polyMesh;
|
||||
class fvMesh;
|
||||
class Random;
|
||||
class randomGenerator;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class patchInjectionBase Declaration
|
||||
@ -108,7 +108,7 @@ public:
|
||||
virtual void setPositionAndCell
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
Random& rnd,
|
||||
randomGenerator& rndGen,
|
||||
barycentric& coordinates,
|
||||
label& celli,
|
||||
label& tetFacei,
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -179,8 +179,8 @@ void Foam::ReactingLookupTableInjection<CloudType>::setPositionAndCell
|
||||
label injectorI = 0;
|
||||
if (randomise_)
|
||||
{
|
||||
Random& rnd = this->owner().rndGen();
|
||||
injectorI = rnd.sampleAB<label>(0, injectorCells_.size());
|
||||
randomGenerator& rndGen = this->owner().rndGen();
|
||||
injectorI = rndGen.sampleAB<label>(0, injectorCells_.size());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -185,8 +185,8 @@ void Foam::ReactingMultiphaseLookupTableInjection<CloudType>::setPositionAndCell
|
||||
label injectorI = 0;
|
||||
if (randomise_)
|
||||
{
|
||||
Random& rnd = this->owner().rndGen();
|
||||
injectorI = rnd.sampleAB<label>(0, injectorCells_.size());
|
||||
randomGenerator& rndGen = this->owner().rndGen();
|
||||
injectorI = rndGen.sampleAB<label>(0, injectorCells_.size());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -133,7 +133,7 @@ public:
|
||||
const vector& injectionPos,
|
||||
const scalar pAmbient,
|
||||
const scalar chi,
|
||||
Random& rndGen
|
||||
randomGenerator& rndGen
|
||||
) const = 0;
|
||||
};
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -92,7 +92,7 @@ void Foam::BlobsSheetAtomisation<CloudType>::update
|
||||
const vector& injectionPos,
|
||||
const scalar pAmbient,
|
||||
const scalar chi,
|
||||
Random& rndGen
|
||||
randomGenerator& rndGen
|
||||
) const
|
||||
{
|
||||
scalar lBU =
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -117,7 +117,7 @@ public:
|
||||
const vector& injectionPos,
|
||||
const scalar pAmbient,
|
||||
const scalar chi,
|
||||
Random& rndGen
|
||||
randomGenerator& rndGen
|
||||
) const;
|
||||
};
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -116,7 +116,7 @@ void Foam::LISAAtomisation<CloudType>::update
|
||||
const vector& injectionPos,
|
||||
const scalar pAmbient,
|
||||
const scalar chi,
|
||||
Random& rndGen
|
||||
randomGenerator& rndGen
|
||||
) const
|
||||
{
|
||||
if (volFlowRate < small)
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -138,7 +138,7 @@ public:
|
||||
const vector& injectionPos,
|
||||
const scalar pAmbient,
|
||||
const scalar chi,
|
||||
Random& rndGen
|
||||
randomGenerator& rndGen
|
||||
) const;
|
||||
};
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -88,7 +88,7 @@ void Foam::NoAtomisation<CloudType>::update
|
||||
const vector& injectionPos,
|
||||
const scalar pAmbient,
|
||||
const scalar chi,
|
||||
Random& rndGen
|
||||
randomGenerator& rndGen
|
||||
) const
|
||||
{}
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -99,7 +99,7 @@ public:
|
||||
const vector& injectionPos,
|
||||
const scalar pAmbient,
|
||||
const scalar chi,
|
||||
Random& rndGen
|
||||
randomGenerator& rndGen
|
||||
) const;
|
||||
};
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -139,7 +139,7 @@ bool Foam::SHF<CloudType>::update
|
||||
scalar& massChild
|
||||
)
|
||||
{
|
||||
Random& rndGen = this->owner().rndGen();
|
||||
randomGenerator& rndGen = this->owner().rndGen();
|
||||
|
||||
bool addChild = false;
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -111,7 +111,7 @@ bool Foam::TAB<CloudType>::update
|
||||
scalar& massChild
|
||||
)
|
||||
{
|
||||
Random& rndGen = this->owner().rndGen();
|
||||
randomGenerator& rndGen = this->owner().rndGen();
|
||||
|
||||
scalar r = 0.5*d;
|
||||
scalar r2 = r*r;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -180,8 +180,8 @@ void Foam::ThermoLookupTableInjection<CloudType>::setPositionAndCell
|
||||
label injectorI = 0;
|
||||
if (randomise_)
|
||||
{
|
||||
Random& rnd = this->owner().rndGen();
|
||||
injectorI = rnd.sampleAB<label>(0, injectorCells_.size());
|
||||
randomGenerator& rndGen = this->owner().rndGen();
|
||||
injectorI = rndGen.sampleAB<label>(0, injectorCells_.size());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -202,15 +202,15 @@ Foam::forceSuSp Foam::BrownianMotionForce<CloudType>::calcCoupled
|
||||
|
||||
// To generate a spherical distribution:
|
||||
|
||||
Random& rnd = this->owner().rndGen();
|
||||
randomGenerator& rndGen = this->owner().rndGen();
|
||||
|
||||
const scalar theta = rnd.scalar01()*twoPi;
|
||||
const scalar u = 2*rnd.scalar01() - 1;
|
||||
const scalar theta = rndGen.scalar01()*twoPi;
|
||||
const scalar u = 2*rndGen.scalar01() - 1;
|
||||
|
||||
const scalar a = sqrt(1 - sqr(u));
|
||||
const vector dir(a*cos(theta), a*sin(theta), u);
|
||||
|
||||
value.Su() = f*mag(rnd.scalarNormal())*dir;
|
||||
value.Su() = f*mag(rndGen.scalarNormal())*dir;
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -46,7 +46,7 @@ SourceFiles
|
||||
#define BrownianMotionForce_H
|
||||
|
||||
#include "ParticleForce.H"
|
||||
#include "Random.H"
|
||||
#include "randomGenerator.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -65,7 +65,7 @@ class BrownianMotionForce
|
||||
// Private Data
|
||||
|
||||
//- Reference to the cloud random number generator
|
||||
Random& rndGen_;
|
||||
randomGenerator& rndGen_;
|
||||
|
||||
//- Molecular free path length [m]
|
||||
const scalar lambda_;
|
||||
|
||||
@ -51,7 +51,7 @@ License
|
||||
#include "meshTools.H"
|
||||
#include "OFstream.H"
|
||||
#include "geomDecomp.H"
|
||||
#include "Random.H"
|
||||
#include "randomGenerator.H"
|
||||
#include "searchableSurfaces.H"
|
||||
#include "treeBoundBox.H"
|
||||
#include "fvMeshTools.H"
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -26,7 +26,7 @@ License
|
||||
#include "extendedEdgeMesh.H"
|
||||
#include "surfaceFeatures.H"
|
||||
#include "triSurface.H"
|
||||
#include "Random.H"
|
||||
#include "randomGenerator.H"
|
||||
#include "Time.H"
|
||||
#include "OBJstream.H"
|
||||
#include "DynamicField.H"
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user