Skip to content
Snippets Groups Projects
Commit 386cafd8 authored by mattijs's avatar mattijs Committed by Andrew Heather
Browse files

ENH: patchSet: merge collocated points. Fixes #1453.

parent a563db32
No related branches found
No related tags found
No related merge requests found
......@@ -28,6 +28,7 @@ License
#include "addToRunTimeSelectionTable.H"
#include "searchableSurface.H"
#include "Time.H"
#include "mergePoints.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
......@@ -126,15 +127,58 @@ void Foam::patchEdgeSet::genSamples()
samplingSegments.shrink();
samplingCurveDist.shrink();
setSamples
labelList pointMap;
const label nMerged = mergePoints
(
samplingPts,
samplingCells,
samplingFaces,
samplingSegments,
samplingCurveDist
SMALL, //const scalar mergeTol,
false, //const bool verbose,
pointMap,
origin_
);
if (nMerged == 0)
{
setSamples
(
samplingPts,
samplingCells,
samplingFaces,
samplingSegments,
samplingCurveDist
);
}
else
{
// Compress out duplicates
List<point> newSamplingPts(nMerged);
List<label> newSamplingCells(nMerged);
List<label> newSamplingFaces(nMerged);
List<label> newSamplingSegments(nMerged);
List<scalar> newSamplingCurveDist(nMerged);
forAll(pointMap, i)
{
const label newi = pointMap[i];
newSamplingPts[newi] = samplingPts[i];
newSamplingCells[newi] = samplingCells[i];
newSamplingFaces[newi] = samplingFaces[i];
newSamplingSegments[newi] = samplingSegments[i];
newSamplingCurveDist[newi] = samplingCurveDist[i];
}
setSamples
(
newSamplingPts,
newSamplingCells,
newSamplingFaces,
newSamplingSegments,
newSamplingCurveDist
);
}
if (debug)
{
write(Info);
......
......@@ -49,6 +49,8 @@ Usage
type patchEdge;
axis x;
// List of patches to sample (into single file). Note: supports
// wildcards.
patches (movingWall);
// Surface type
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment