mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: searchableSphere: findNearest
This commit is contained in:
@ -47,13 +47,11 @@ Foam::pointIndexHit Foam::searchableSphere::findNearest
|
|||||||
{
|
{
|
||||||
pointIndexHit info(false, sample, -1);
|
pointIndexHit info(false, sample, -1);
|
||||||
|
|
||||||
const vector n(sample-centre_);
|
const vector n(sample - centre_);
|
||||||
scalar magSqrN = magSqr(n);
|
scalar magN = mag(n);
|
||||||
|
|
||||||
if (nearestDistSqr >= magSqrN)
|
if (nearestDistSqr >= sqr(magN - radius_))
|
||||||
{
|
{
|
||||||
scalar magN = Foam::sqrt(magSqrN);
|
|
||||||
|
|
||||||
if (magN < ROOTVSMALL)
|
if (magN < ROOTVSMALL)
|
||||||
{
|
{
|
||||||
info.rawPoint() = centre_ + vector(1,0,0)*radius_;
|
info.rawPoint() = centre_ + vector(1,0,0)*radius_;
|
||||||
|
|||||||
Reference in New Issue
Block a user