MCPcopy Create free account
hub / github.com/OpenFOAM/OpenFOAM-dev / findNearer

Function findNearer

src/meshTools/meshSearch/meshSearch.C:46–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
45
46bool 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
72bool Foam::meshSearch::findNearer

Callers 1

meshSearch.CFile · 0.85

Calls 2

forAllFunction · 0.50
magSqrFunction · 0.50

Tested by

no test coverage detected