treeBoundBox: Removed unecessary randomisation

Tree bound boxes are expanded asymmetrically to reduce the liklihood of
octree faces aliging with mesh faces and edges. The asymmetry is now
generated using hard-coded irrational numbers, rather than using a
random generator.

The asymmetry was effectively already hard coded. The random numbers are
only pseudo random, so the same numbers were being applied to the bound
boxes every time. This change simply removes the overhead of creating
the generator, and also gets rid of some duplicated code.
This commit is contained in:
Will Bainbridge
2018-06-07 14:04:48 +01:00
parent dc2c1e2d6d
commit 88a218ce84
24 changed files with 43 additions and 186 deletions

View File

@ -174,12 +174,9 @@ void createBoundaryEdgeTrees
// geometry there are less face/edge aligned items.
treeBoundBox bb
(
treeBoundBox(UList<point>(surf.localPoints())).extend(rndGen, 1e-4)
treeBoundBox(UList<point>(surf.localPoints())).extend(1e-4)
);
bb.min() -= point(rootVSmall, rootVSmall, rootVSmall);
bb.max() += point(rootVSmall, rootVSmall, rootVSmall);
bEdgeTrees.set
(
surfI,

View File

@ -144,18 +144,13 @@ int main(int argc, char *argv[])
#include "createPolyMesh.H"
Random rndGen(653213);
// Determine mesh bounding boxes:
List<List<treeBoundBox>> meshBb(Pstream::nProcs());
{
meshBb[Pstream::myProcNo()] = List<treeBoundBox>
(
1,
treeBoundBox
(
boundBox(mesh.points(), false)
).extend(rndGen, 1e-3)
treeBoundBox(boundBox(mesh.points(), false)).extend(1e-3)
);
Pstream::gatherList(meshBb);
Pstream::scatterList(meshBb);