diff --git a/applications/utilities/surface/surfaceSubset/surfaceSubset.C b/applications/utilities/surface/surfaceSubset/surfaceSubset.C index fb41623074d1eaba2993cd6c3b14379f0a5ec8c9..0fb1feed703b5d85e99bc874ab1c3e853f98a99e 100644 --- a/applications/utilities/surface/surfaceSubset/surfaceSubset.C +++ b/applications/utilities/surface/surfaceSubset/surfaceSubset.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -249,7 +249,11 @@ int main(int argc, char *argv[]) // search engine indexedOctree<treeDataTriSurface> selectTree ( - treeDataTriSurface(selectSurf), + treeDataTriSurface + ( + selectSurf, + indexedOctree<treeDataTriSurface>::perturbTol() + ), bb.extend(rndGen, 1E-4), // slightly randomize bb 8, // maxLevel 10, // leafsize diff --git a/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.C b/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.C index 10cb44fa272e2d7581a50d0a6083019745358525..a35b62474b93a655c98c0964ffecb999fafe0e43 100644 --- a/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.C +++ b/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.C @@ -714,7 +714,7 @@ Foam::point Foam::indexedOctree<Type>::pushPoint ) { // Get local length scale. - const vector perturbVec = perturbTol_*(bb.span()); + const vector perturbVec = perturbTol_*bb.span(); point perturbedPt(pt); diff --git a/src/meshTools/indexedOctree/treeDataTriSurface.C b/src/meshTools/indexedOctree/treeDataTriSurface.C index 63c76de4825b465120f21a8f8c4c0b5c274e99c6..3ce85caa795a70f1078c4aa8a53723a962ec5aba 100644 --- a/src/meshTools/indexedOctree/treeDataTriSurface.C +++ b/src/meshTools/indexedOctree/treeDataTriSurface.C @@ -179,9 +179,14 @@ defineTypeNameAndDebug(Foam::treeDataTriSurface, 0); // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // Construct from components -Foam::treeDataTriSurface::treeDataTriSurface(const triSurface& surface) +Foam::treeDataTriSurface::treeDataTriSurface +( + const triSurface& surface, + const scalar planarTol +) : - surface_(surface) + surface_(surface), + planarTol_(planarTol) {} @@ -437,7 +442,7 @@ bool Foam::treeDataTriSurface::intersects dir, points, intersection::HALF_RAY, - indexedOctree<treeDataTriSurface>::perturbTol() + planarTol_ ); if (inter.hit() && inter.distance() <= 1) diff --git a/src/meshTools/indexedOctree/treeDataTriSurface.H b/src/meshTools/indexedOctree/treeDataTriSurface.H index 47778c61c598c348c0a523546e799ad92ac2ee69..4029b507ff29307b45a44f7d514ace1d5a1265a4 100644 --- a/src/meshTools/indexedOctree/treeDataTriSurface.H +++ b/src/meshTools/indexedOctree/treeDataTriSurface.H @@ -55,8 +55,11 @@ class treeDataTriSurface { // Private data + //- Reference to triSurface const triSurface& surface_; + //- Tolerance to use for intersection tests + const scalar planarTol_; // Private Member Functions @@ -83,8 +86,9 @@ public: // Constructors - //- Construct from triSurface. Holds reference. - treeDataTriSurface(const triSurface&); + //- Construct from triSurface and tolerance for intersection + // tests. Holds reference. + treeDataTriSurface(const triSurface&, const scalar planarTol); // Member Functions diff --git a/src/meshTools/searchableSurface/triSurfaceMesh.C b/src/meshTools/searchableSurface/triSurfaceMesh.C index c3c7c69b34b679fabae31596f057431daef1c72c..c532ac3d399754382004951df214177767d82208 100644 --- a/src/meshTools/searchableSurface/triSurfaceMesh.C +++ b/src/meshTools/searchableSurface/triSurfaceMesh.C @@ -492,7 +492,7 @@ void Foam::triSurfaceMesh::movePoints(const pointField& newPoints) const Foam::indexedOctree<Foam::treeDataTriSurface>& - Foam::triSurfaceMesh::tree() const +Foam::triSurfaceMesh::tree() const { if (tree_.empty()) { @@ -528,7 +528,7 @@ const Foam::indexedOctree<Foam::treeDataTriSurface>& ( new indexedOctree<treeDataTriSurface> ( - treeDataTriSurface(*this), + treeDataTriSurface(*this, tolerance_), bb, maxTreeDepth_, // maxLevel 10, // leafsize @@ -544,7 +544,7 @@ const Foam::indexedOctree<Foam::treeDataTriSurface>& const Foam::indexedOctree<Foam::treeDataEdge>& - Foam::triSurfaceMesh::edgeTree() const +Foam::triSurfaceMesh::edgeTree() const { if (edgeTree_.empty()) { diff --git a/src/meshTools/triSurface/triSurfaceSearch/triSurfaceSearch.C b/src/meshTools/triSurface/triSurfaceSearch/triSurfaceSearch.C index 19a3e4953cc6b0abb8ddf42feea3b006b96c9049..92d8f8ad6dbb9d2d9dcfd280352499f83978f76a 100644 --- a/src/meshTools/triSurface/triSurfaceSearch/triSurfaceSearch.C +++ b/src/meshTools/triSurface/triSurfaceSearch/triSurfaceSearch.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -64,7 +64,11 @@ Foam::triSurfaceSearch::triSurfaceSearch(const triSurface& surface) ( new indexedOctree<treeDataTriSurface> ( - treeDataTriSurface(surface_), + treeDataTriSurface + ( + surface_, + indexedOctree<treeDataTriSurface>::perturbTol() + ), treeBb, 8, // maxLevel 10, // leafsize