1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation, either version 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
24 \*---------------------------------------------------------------------------*/
26 #include "primitiveMesh.H"
27 #include "SortableList.H"
29 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
31 bool Foam::primitiveMesh::checkPointNearness
34 const scalar reportDistSqr,
38 const pointField& points = this->points();
41 SortableList<scalar> sortedMag(magSqr(points));
45 for (label i = 1; i < sortedMag.size(); i++)
47 label pti = sortedMag.indices()[i];
49 // Compare pti to any previous points with similar sortedMag
53 j >= 0 && (sortedMag[j] > sortedMag[i]-reportDistSqr);
57 label prevPtI = sortedMag.indices()[j];
59 if (magSqr(points[pti] - points[prevPtI]) < reportDistSqr)
61 // Commented out in 1.6.x. HJ, 17/Aug/2010
62 //// Check if unconnected.
63 //const labelList& pEdges = pointEdges()[pti];
65 //bool connected = false;
67 //forAll(pEdges, pEdgei)
69 // if (edges()[pEdges[pEdgei]].otherVertex(prevPtI) != -1)
83 setPtr->insert(prevPtI);
90 reduce(nClose, sumOp<label>());
96 Info<< " <<Points closer than " << Foam::sqrt(reportDistSqr)
97 << " together found, number: " << nClose
110 // ************************************************************************* //