Commit 24a82f2d authored by mattijs's avatar mattijs
Browse files

ENH: treeDataCell: increase duplicity

parent 9f7fcc68
......@@ -375,7 +375,7 @@ Foam::primitiveMesh::cellTree() const
overallBb,
8, // maxLevel
10, // leafsize
3.0 // duplicity
5.0 // duplicity
);
}
......
......@@ -167,7 +167,7 @@ void Foam::InteractionLists<ParticleType>::buildInteractionLists()
procBbRndExt,
8, // maxLevel,
10, // leafSize,
100.0
100.0 // duplicity
);
ril_.setSize(cellBbsToExchange.size());
......@@ -386,7 +386,7 @@ void Foam::InteractionLists<ParticleType>::buildInteractionLists()
procBbRndExt,
8, // maxLevel,
10, // leafSize,
100.0
100.0 // duplicity
);
rwfil_.setSize(wallFaceBbsToExchange.size());
......
......@@ -30,7 +30,6 @@ License
#include "demandDrivenData.H"
#include "treeDataCell.H"
#include "treeDataFace.H"
#include "treeDataPoint.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
......@@ -508,6 +507,21 @@ Foam::meshSearch::meshSearch(const polyMesh& mesh, const bool faceDecomp)
{}
// Construct with a custom bounding box
Foam::meshSearch::meshSearch
(
const polyMesh& mesh,
const treeBoundBox& bb,
const bool faceDecomp
)
:
mesh_(mesh),
faceDecomp_(faceDecomp)
{
overallBbPtr_.reset(new treeBoundBox(bb));
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::meshSearch::~meshSearch()
......@@ -527,6 +541,21 @@ const Foam::indexedOctree<Foam::treeDataFace>& Foam::meshSearch::boundaryTree()
// Construct tree
//
if (!overallBbPtr_.valid())
{
Random rndGen(261782);
overallBbPtr_.reset
(
new treeBoundBox(mesh_.points())
);
treeBoundBox& overallBb = overallBbPtr_();
// Extend slightly and make 3D
overallBb = overallBb.extend(rndGen, 1E-4);
overallBb.min() -= point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
overallBb.max() += point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
}
// all boundary faces (not just walls)
labelList bndFaces(mesh_.nFaces()-mesh_.nInternalFaces());
forAll(bndFaces, i)
......@@ -534,12 +563,6 @@ const Foam::indexedOctree<Foam::treeDataFace>& Foam::meshSearch::boundaryTree()
bndFaces[i] = mesh_.nInternalFaces() + i;
}
treeBoundBox overallBb(mesh_.points());
Random rndGen(123456);
overallBb = overallBb.extend(rndGen, 1E-4);
overallBb.min() -= point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
overallBb.max() += point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
boundaryTreePtr_.reset
(
new indexedOctree<treeDataFace>
......@@ -550,7 +573,7 @@ const Foam::indexedOctree<Foam::treeDataFace>& Foam::meshSearch::boundaryTree()
mesh_,
bndFaces // boundary faces only
),
overallBb, // overall search domain
overallBbPtr_(), // overall search domain
8, // maxLevel
10, // leafsize
3.0 // duplicity
......@@ -567,13 +590,24 @@ const
{
if (!cellTreePtr_.valid())
{
treeBoundBox overallBb(mesh_.points());
//
// Construct tree
//
Random rndGen(261782);
if (!overallBbPtr_.valid())
{
Random rndGen(261782);
overallBbPtr_.reset
(
new treeBoundBox(mesh_.points())
);
overallBb = overallBb.extend(rndGen, 1E-4);
overallBb.min() -= point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
overallBb.max() += point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
treeBoundBox& overallBb = overallBbPtr_();
// Extend slightly and make 3D
overallBb = overallBb.extend(rndGen, 1E-4);
overallBb.min() -= point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
overallBb.max() += point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
}
cellTreePtr_.reset
(
......@@ -584,10 +618,10 @@ const
false, // not cache bb
mesh_
),
overallBb,
overallBbPtr_(),
8, // maxLevel
10, // leafsize
3.0 // duplicity
6.0 // duplicity
)
);
}
......@@ -904,6 +938,7 @@ void Foam::meshSearch::clearOut()
{
boundaryTreePtr_.clear();
cellTreePtr_.clear();
overallBbPtr_.clear();
}
......
......@@ -49,6 +49,7 @@ class polyMesh;
class treeDataCell;
class treeDataFace;
template<class Type> class indexedOctree;
class treeBoundBox;
/*---------------------------------------------------------------------------*\
Class meshSearch Declaration
......@@ -64,8 +65,10 @@ class meshSearch
//- Whether to use face decomposition for all geometric tests
const bool faceDecomp_;
//- demand driven octrees
//- data bounding box
mutable autoPtr<treeBoundBox> overallBbPtr_;
//- demand driven octrees
mutable autoPtr<indexedOctree<treeDataFace> > boundaryTreePtr_;
mutable autoPtr<indexedOctree<treeDataCell> > cellTreePtr_;
......@@ -163,9 +166,19 @@ public:
// Constructors
//- Construct from components
//- Construct from components. Constructs bb slightly bigger than
// mesh points bb.
meshSearch(const polyMesh& mesh, const bool faceDecomp = true);
//- Construct with a custom bounding box. Any mesh element outside
// bb will not be found. Up to user to make sure bb
// extends slightly beyond wanted elements.
meshSearch
(
const polyMesh& mesh,
const treeBoundBox& bb,
const bool faceDecomp = true
);
//- Destructor
~meshSearch();
......
......@@ -106,7 +106,7 @@ void Foam::meshToMesh::calcAddressing()
shiftedBb, // overall bounding box
8, // maxLevel
10, // leafsize
3.0 // duplicity
6.0 // duplicity
);
if (debug)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment