diff --git a/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.C b/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.C index 6295d6f195..0e588f1b73 100644 --- a/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.C +++ b/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.C @@ -352,124 +352,6 @@ Foam::label Foam::indexedOctree::compactContents } -template -bool Foam::indexedOctree::quickCircumsphereRejection -( - const label nodeI, - const point& cc, - const scalar crSqr, - const List& nearestDistances -) const -{ - const node& nod = nodes_[nodeI]; - - volumeType nodeType = volumeType(nodeTypes_.get(nodeI<<3)); - - //scalar boxDist = nearestDistances[nodeI] + 0.5*nod.bb_.mag(); - scalar boxDist = crSqr + magSqr(cc - nod.bb_.midpoint()); - - if - ( - nodeType == INSIDE - //&& (crSqr < sqr(boxDist)) - && (boxDist < sqr(nearestDistances[nodeI])) - ) - { - return true; - } - else - { - direction octant = nod.bb_.subOctant(cc); - - labelBits index = nod.subNodes_[octant]; - - if (isNode(index)) - { - return quickCircumsphereRejection - ( - getNode(index), - cc, - crSqr, - nearestDistances - ); - } - else - { - return false; - } - } -} - - -template -bool Foam::indexedOctree::quickCircumsphereRejection -( - const point& cc, - const scalar crSqr, - const List& nearestDistances -) const -{ - if (nodes_.size()) - { - return quickCircumsphereRejection - ( - 0, - cc, - crSqr, - nearestDistances - ); - } - - return false; -} - - -template -Foam::scalar -Foam::indexedOctree::calcNearestDistance -( - const label nodeI -) const -{ - const node& nod = nodes_[nodeI]; - - const point& nodeCentre = nod.bb_.midpoint(); - - scalar nearestDistance = 0.0; - - pointIndexHit pHit = findNearest(nodeCentre, sqr(GREAT)); - - if (pHit.hit()) - { - nearestDistance = mag(pHit.hitPoint() - nodeCentre); - } - else - { - WarningIn("Foam::indexedOctree::calcNearestDistance(const label)") - << "Cannot calculate distance of nearest point on surface from " - << "the midpoint of the octree node. Returning distance of zero." - << endl; - } - - return nearestDistance; -} - - -template -Foam::List -Foam::indexedOctree::calcNearestDistance() const -{ - List nearestDistances(nodes_.size()); - - forAll(nearestDistances, nodeI) - { - nearestDistances[nodeI] = calcNearestDistance(nodeI); - } - - return nearestDistances; -} - - // Pre-calculates wherever possible the volume status per node/subnode. // Recurses to determine status of lowest level boxes. Level above is // combination of octants below. diff --git a/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.H b/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.H index 40ee7a8a32..0a70bee918 100644 --- a/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.H +++ b/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.H @@ -201,16 +201,6 @@ private: label& compactI ); - scalar calcNearestDistance(const label nodeI) const; - - bool quickCircumsphereRejection - ( - const label nodeI, - const point& cc, - const scalar crSqr, - const List& nearestDistances - ) const; - //- Determine inside/outside per node (mixed if cannot be // determined). Only valid for closed shapes. volumeType calcVolumeType(const label nodeI) const; @@ -658,16 +648,6 @@ public: CompareOp& cop ) const; - //- Return a list containing the nearest distance of nodes to any - // shapes - List calcNearestDistance() const; - - bool quickCircumsphereRejection - ( - const point& cc, - const scalar crSqr, - const List& nearestDistances - ) const; // Write