Commit 13922260 authored by mattijs's avatar mattijs Committed by Andrew Heather
Browse files

BUG: snappyHexMesh: attraction distance mapping. Fixes #941.

parent cbc3953f
......@@ -308,7 +308,7 @@ void Foam::snappySnapDriver::calcNearestFace
(
labelList(1, zoneSurfi),
fc,
sqr(faceSnapDist),// sqr of attract dist
sqr(scalarField(faceSnapDist, ppFaces)),// sqr of attract dist
hitSurface,
hitInfo,
hitRegion,
......@@ -384,7 +384,7 @@ void Foam::snappySnapDriver::calcNearestFace
(
unzonedSurfaces,
fc,
sqr(faceSnapDist),// sqr of attract dist
sqr(scalarField(faceSnapDist, ppFaces)),// sqr of attract dist
hitSurface,
hitInfo,
hitRegion,
......
......@@ -356,6 +356,13 @@ void Foam::searchableSurfacesQueries::findNearest
{
// Find nearest. Return -1 or nearest point
if (samples.size() != nearestDistSqr.size())
{
FatalErrorInFunction << "Inconsistent sizes. samples:" << samples.size()
<< " search-radius:" << nearestDistSqr.size()
<< exit(FatalError);
}
// Initialise
nearestSurfaces.setSize(samples.size());
nearestSurfaces = -1;
......@@ -407,6 +414,14 @@ void Foam::searchableSurfacesQueries::findNearest
{
// Find nearest. Return -1 or nearest point
if (samples.size() != nearestDistSqr.size())
{
FatalErrorInFunction << "Inconsistent sizes. samples:" << samples.size()
<< " search-radius:" << nearestDistSqr.size()
<< exit(FatalError);
}
if (regionIndices.empty())
{
findNearest
......@@ -470,6 +485,15 @@ void Foam::searchableSurfacesQueries::findNearest
{
// Multi-surface findNearest
if (start.size() != distSqr.size())
{
FatalErrorInFunction << "Inconsistent sizes. samples:" << start.size()
<< " search-radius:" << distSqr.size()
<< exit(FatalError);
}
vectorField normal;
List<pointIndexHit> info;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment