ENH: mergePoints: new API, now templated

This commit is contained in:
mattijs
2011-12-08 16:32:46 +00:00
parent 735dd36124
commit 17a38cff7c
6 changed files with 22 additions and 31 deletions

View File

@ -63,27 +63,26 @@ Foam::label Foam::autoSnapDriver::getCollocatedPoints
)
{
labelList pointMap;
pointField newPoints;
bool hasMerged = mergePoints
label nUnique = mergePoints
(
points, // points
tol, // mergeTol
false, // verbose
pointMap,
newPoints
pointMap
);
bool hasMerged = (nUnique < points.size());
if (!returnReduce(hasMerged, orOp<bool>()))
{
return 0;
}
// Determine which newPoints are referenced more than once
// Determine which merged points are referenced more than once
label nCollocated = 0;
// Per old point the newPoint. Or -1 (not set yet) or -2 (already seen
// twice)
labelList firstOldPoint(newPoints.size(), -1);
labelList firstOldPoint(nUnique, -1);
forAll(pointMap, oldPointI)
{
label newPointI = pointMap[oldPointI];