Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
17a38cff
Commit
17a38cff
authored
Dec 08, 2011
by
mattijs
Browse files
ENH: mergePoints: new API, now templated
parent
735dd361
Changes
6
Hide whitespace changes
Inline
Side-by-side
applications/utilities/mesh/manipulation/polyDualMesh/meshDualiser.C
View file @
17a38cff
...
...
@@ -49,19 +49,17 @@ void Foam::meshDualiser::checkPolyTopoChange(const polyTopoChange& meshMod)
}
labelList
oldToNew
;
pointField
newPoints
;
bool
hasMerged
=
mergePoints
label
nUnique
=
mergePoints
(
points
,
1E-6
,
false
,
oldToNew
,
newPoints
oldToNew
);
if
(
hasMerged
)
if
(
nUnique
<
points
.
size
()
)
{
labelListList
newToOld
(
invertOneToMany
(
n
ewPoints
.
size
()
,
oldToNew
));
labelListList
newToOld
(
invertOneToMany
(
n
Unique
,
oldToNew
));
forAll
(
newToOld
,
newI
)
{
...
...
@@ -225,17 +223,15 @@ Foam::label Foam::meshDualiser::addInternalFace
pointField
facePoints
(
meshMod
.
points
(),
newFace
);
labelList
oldToNew
;
pointField
newPoints
;
bool
hasMerged
=
mergePoints
label
nUnique
=
mergePoints
(
facePoints
,
1E-6
,
false
,
oldToNew
,
newPoints
oldToNew
);
if
(
hasMerged
)
if
(
nUnique
<
facePoints
.
size
()
)
{
FatalErrorIn
(
"addInternalFace(..)"
)
<<
"verts:"
<<
verts
<<
" newFace:"
<<
newFace
...
...
src/OpenFOAM/Make/files
View file @
17a38cff
...
...
@@ -45,6 +45,7 @@ primitives/Tensor/lists/symmTensorList.C
primitives/Tensor/lists/tensorList.C
primitives/Vector/complexVector/complexVector.C
primitives/Vector/floatVector/floatVector.C
primitives/Vector/labelVector/labelVector.C
primitives/Vector/vector/vector.C
primitives/Vector/lists/vectorList.C
...
...
@@ -501,7 +502,6 @@ meshes/treeBoundBox/treeBoundBox.C
meshTools = meshes/meshTools
$(meshTools)/matchPoints.C
$(meshTools)/mergePoints.C
fields/UniformDimensionedFields/uniformDimensionedFields.C
fields/cloud/cloud.C
...
...
src/dynamicMesh/fvMeshDistribute/fvMeshDistribute.C
View file @
17a38cff
...
...
@@ -36,7 +36,6 @@ License
#include "removeCells.H"
#include "polyModifyFace.H"
#include "polyRemovePoint.H"
#include "mergePoints.H"
#include "mapDistributePolyMesh.H"
#include "surfaceFields.H"
#include "syncTools.H"
...
...
src/dynamicMesh/polyMeshAdder/polyMeshAdder.C
View file @
17a38cff
...
...
@@ -1859,24 +1859,22 @@ Foam::Map<Foam::label> Foam::polyMeshAdder::findSharedPoints
);
labelList
toMergedPoints
;
pointField
mergedPoints
;
bool
hasMerged
=
Foam
::
mergePoints
label
nUnique
=
Foam
::
mergePoints
(
connectedPoints
,
mergeDist
,
false
,
toMergedPoints
,
mergedPoints
toMergedPoints
);
if
(
hasMerged
)
if
(
nUnique
<
connectedPoints
.
size
()
)
{
// Invert toMergedPoints
const
labelListList
mergeSets
(
invertOneToMany
(
mergedPoints
.
size
()
,
nUnique
,
toMergedPoints
)
);
...
...
@@ -1919,8 +1917,7 @@ Foam::Map<Foam::label> Foam::polyMeshAdder::findSharedPoints
//- Old: geometric merging. Causes problems for two close shared points.
//labelList sharedToMerged;
//pointField mergedPoints;
//bool hasMerged = Foam::mergePoints
//label nUnique = Foam::mergePoints
//(
// pointField
// (
...
...
@@ -1929,8 +1926,7 @@ Foam::Map<Foam::label> Foam::polyMeshAdder::findSharedPoints
// ),
// mergeDist,
// false,
// sharedToMerged,
// mergedPoints
// sharedToMerged
//);
//
//// Find out which sets of points get merged and create a map from
...
...
@@ -1938,7 +1934,7 @@ Foam::Map<Foam::label> Foam::polyMeshAdder::findSharedPoints
//
//Map<label> pointToMaster(10*sharedToMerged.size());
//
//if (
hasMerged
)
//if (
nUnique < sharedPointLabels.size()
)
//{
// labelListList mergeSets
// (
...
...
src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriver.C
View file @
17a38cff
...
...
@@ -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
newP
oints are referenced more than once
// Determine which
merged p
oints 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
(
n
ewPoints
.
size
()
,
-
1
);
labelList
firstOldPoint
(
n
Unique
,
-
1
);
forAll
(
pointMap
,
oldPointI
)
{
label
newPointI
=
pointMap
[
oldPointI
];
...
...
src/meshTools/triSurface/triSurfaceTools/triSurfaceTools.C
View file @
17a38cff
...
...
@@ -2096,7 +2096,8 @@ Foam::triSurface Foam::triSurfaceTools::mergePoints
(
newTriangles
,
surf
.
patches
(),
newPoints
newPoints
,
true
//reuse storage
);
}
else
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment