diff --git a/etc/bashrc b/etc/bashrc index 7be0dc552f..4fb5d511df 100644 --- a/etc/bashrc +++ b/etc/bashrc @@ -32,7 +32,7 @@ #------------------------------------------------------------------------------ export WM_PROJECT=OpenFOAM -export WM_PROJECT_VERSION=dev-cvMesh-foghorn +export WM_PROJECT_VERSION=dev ################################################################################ # USER EDITABLE PART: Changes made here may be lost with the next upgrade diff --git a/src/OpenFOAM/primitives/random/cachedRandom/cachedRandom.C b/src/OpenFOAM/primitives/random/cachedRandom/cachedRandom.C index 62f40e5454..71b73e8463 100644 --- a/src/OpenFOAM/primitives/random/cachedRandom/cachedRandom.C +++ b/src/OpenFOAM/primitives/random/cachedRandom/cachedRandom.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,6 +25,7 @@ License #include "cachedRandom.H" #include "OSspecific.H" +#include "PstreamReduceOps.H" // * * * * * * * * * * * * * private Member Functions * * * * * * * * * * * // @@ -142,6 +143,78 @@ Foam::scalar Foam::cachedRandom::position } +template<> +Foam::label Foam::cachedRandom::globalSample01() +{ + scalar value = -GREAT; + + if (Pstream::master()) + { + value = scalar01(); + } + + reduce(value, maxOp()); + + return round(value); +} + + +template<> +Foam::scalar Foam::cachedRandom::globalSample01() +{ + scalar value = -GREAT; + + if (Pstream::master()) + { + value = scalar01(); + } + + reduce(value, maxOp()); + + return value; +} + + +template<> +Foam::label Foam::cachedRandom::globalPosition +( + const label& start, + const label& end +) +{ + label value = labelMin; + + if (Pstream::master()) + { + value = round(scalar01()*(end - start)); + } + + reduce(value, maxOp