96 void insertDuplicateMerge
107 forAll(duplicates, bFaceI)
109 label otherFaceI = duplicates[bFaceI];
111 if (otherFaceI != -1 && otherFaceI > bFaceI)
118 label own0 = faceOwner[face0];
119 label own1 = faceOwner[face1];
124 label zoneID = faceZones.
whichZone(face0);
125 bool zoneFlip =
false;
129 const faceZone& fZone = faceZones[zoneID];
153 label zoneID = faceZones.
whichZone(face1);
154 bool zoneFlip =
false;
158 const faceZone& fZone = faceZones[zoneID];
197 forAll(duplicates, bFaceI)
199 if (duplicates[bFaceI] != -1)
204 if (isA<processorPolyPatch>(patches[patchI]))
206 FatalErrorIn(
"findBaffles(const polyMesh&, const labelList&)")
207 <<
"Duplicate face " << faceI
208 <<
" is on a processorPolyPatch."
209 <<
"This is not allowed." <<
nl
211 <<
" is on patch:" << patches[patchI].
name()
227 forAll(duplicates, bFaceI)
229 label otherFaceI = duplicates[bFaceI];
231 if (otherFaceI != -1 && otherFaceI > bFaceI)
238 Pout<<
"Writing " << duplicateSet.size()
239 <<
" duplicate faces to faceSet " << duplicateSet.objectPath()
241 duplicateSet.
write();
250 int main(
int argc,
char *argv[])
258 runTime.functionObjects().off();
277 findBaffles(mesh, boundaryFaces);
328 Pout<<
"Topologically splitting duplicate surfaces"
329 <<
", i.e. duplicating points internal to duplicate surfaces."
339 pointDuplicator.setRefinement(
regionSide, meshMod);
343 Pout<<
"Merging duplicate faces."
347 labelList duplicates(findBaffles(mesh, boundaryFaces));
350 insertDuplicateMerge(mesh, duplicates, meshMod);
365 if (map().hasMotionPoints())
374 Pout<<
"Writing mesh to time " << runTime.timeName() <<
endl;
380 const labelList& pointMap = map().pointMap();
382 labelList nDupPerPoint(map().nOldPoints(), 0);
384 pointSet dupPoints(mesh,
"duplicatedPoints", 100);
388 label oldPointI = pointMap[pointI];
390 nDupPerPoint[oldPointI]++;
392 if (nDupPerPoint[oldPointI] > 1)
394 dupPoints.insert(map().reversePointMap()[oldPointI]);
395 dupPoints.insert(pointI);
399 Pout<<
"Writing " << dupPoints.size()
400 <<
" duplicated points to pointSet "
401 << dupPoints.objectPath() <<
nl <<
endl;