| 44 | // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // |
| 45 | |
| 46 | bool Foam::meshSearch::findNearer |
| 47 | ( |
| 48 | const point& sample, |
| 49 | const pointField& points, |
| 50 | label& nearestI, |
| 51 | scalar& nearestDistSqr |
| 52 | ) |
| 53 | { |
| 54 | bool nearer = false; |
| 55 | |
| 56 | forAll(points, pointi) |
| 57 | { |
| 58 | scalar distSqr = magSqr(points[pointi] - sample); |
| 59 | |
| 60 | if (distSqr < nearestDistSqr) |
| 61 | { |
| 62 | nearestDistSqr = distSqr; |
| 63 | nearestI = pointi; |
| 64 | nearer = true; |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | return nearer; |
| 69 | } |
| 70 | |
| 71 | |
| 72 | bool Foam::meshSearch::findNearer |
no test coverage detected