Commit b9de83cf authored by mattijs's avatar mattijs

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

parent f3e10059
......@@ -306,7 +306,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,
......@@ -382,7 +382,7 @@ void Foam::snappySnapDriver::calcNearestFace
(
unzonedSurfaces,
fc,
sqr(faceSnapDist),// sqr of attract dist
sqr(scalarField(faceSnapDist, ppFaces)),// sqr of attract dist
hitSurface,
hitInfo,
hitRegion,
......
......@@ -354,6 +354,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;
......@@ -405,6 +412,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
......@@ -468,6 +483,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