Commit b9de83cf authored by mattijs's avatar mattijs
Browse files

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

parent f3e10059
...@@ -306,7 +306,7 @@ void Foam::snappySnapDriver::calcNearestFace ...@@ -306,7 +306,7 @@ void Foam::snappySnapDriver::calcNearestFace
( (
labelList(1, zoneSurfi), labelList(1, zoneSurfi),
fc, fc,
sqr(faceSnapDist),// sqr of attract dist sqr(scalarField(faceSnapDist, ppFaces)),// sqr of attract dist
hitSurface, hitSurface,
hitInfo, hitInfo,
hitRegion, hitRegion,
...@@ -382,7 +382,7 @@ void Foam::snappySnapDriver::calcNearestFace ...@@ -382,7 +382,7 @@ void Foam::snappySnapDriver::calcNearestFace
( (
unzonedSurfaces, unzonedSurfaces,
fc, fc,
sqr(faceSnapDist),// sqr of attract dist sqr(scalarField(faceSnapDist, ppFaces)),// sqr of attract dist
hitSurface, hitSurface,
hitInfo, hitInfo,
hitRegion, hitRegion,
......
...@@ -354,6 +354,13 @@ void Foam::searchableSurfacesQueries::findNearest ...@@ -354,6 +354,13 @@ void Foam::searchableSurfacesQueries::findNearest
{ {
// Find nearest. Return -1 or nearest point // 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 // Initialise
nearestSurfaces.setSize(samples.size()); nearestSurfaces.setSize(samples.size());
nearestSurfaces = -1; nearestSurfaces = -1;
...@@ -405,6 +412,14 @@ void Foam::searchableSurfacesQueries::findNearest ...@@ -405,6 +412,14 @@ void Foam::searchableSurfacesQueries::findNearest
{ {
// Find nearest. Return -1 or nearest point // 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()) if (regionIndices.empty())
{ {
findNearest findNearest
...@@ -468,6 +483,15 @@ void Foam::searchableSurfacesQueries::findNearest ...@@ -468,6 +483,15 @@ void Foam::searchableSurfacesQueries::findNearest
{ {
// Multi-surface findNearest // Multi-surface findNearest
if (start.size() != distSqr.size())
{
FatalErrorInFunction << "Inconsistent sizes. samples:" << start.size()
<< " search-radius:" << distSqr.size()
<< exit(FatalError);
}
vectorField normal; vectorField normal;
List<pointIndexHit> info; 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