mirror of
https://github.com/OpenFOAM/OpenFOAM-6.git
synced 2025-12-08 06:57:46 +00:00
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:
@ -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,
|
||||
|
||||
@ -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);
|
||||
|
||||
Reference in New Issue
Block a user