From 78338e590ed0cc786ad74ef59198c1228fdd154c Mon Sep 17 00:00:00 2001 From: Will Bainbridge Date: Wed, 29 Nov 2017 11:31:16 +0000 Subject: [PATCH] polyMesh: Stopped re-seeding of RNG on each cell-tree update This is a quick fix. What actually needs doing is the Random and cachedRandom classes need rewriting in terms of the random number functionality in the C++11 STL. These can be initialised/seeded per-object, which makes this sort of bug go away. This resolves bug report https://bugs.openfoam.org/view.php?id=2772 --- src/OpenFOAM/meshes/polyMesh/polyMesh.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OpenFOAM/meshes/polyMesh/polyMesh.C b/src/OpenFOAM/meshes/polyMesh/polyMesh.C index 23943df92..9e46e8e0c 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMesh.C +++ b/src/OpenFOAM/meshes/polyMesh/polyMesh.C @@ -878,7 +878,7 @@ Foam::polyMesh::cellTree() const { treeBoundBox overallBb(points()); - Random rndGen(261782); + static Random rndGen(261782); overallBb = overallBb.extend(rndGen, 1e-4); overallBb.min() -= point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);