ENH: Graceful handling of octree find nearest failures.

This commit is contained in:
graham
2011-02-02 21:06:19 +00:00
parent e664fe1240
commit 7bcf9dda01

View File

@ -896,9 +896,26 @@ void Foam::conformalVoronoiMesh::setVertexSizeAndAlignment()
pointIndexHit info = tree.findNearest(pt, spanSqr);
vit->alignment() = storedAlignments_[info.index()];
if (info.hit())
{
vit->alignment() = storedAlignments_[info.index()];
vit->targetCellSize() = storedSizes_[info.index()];
vit->targetCellSize() = storedSizes_[info.index()];
}
else
{
WarningIn
(
"void "
"Foam::conformalVoronoiMesh::setVertexSizeAndAlignment()"
)
<< "Point " << pt << " did not find a nearest point "
<< " for alignment and size lookup." << endl;
vit->alignment() = requiredAlignment(pt);
vit->targetCellSize() = cellSizeControl().cellSize(pt, false);
}
}
}