69 void insertDuplicateMerge
82 label otherFacei = duplicates[bFacei];
84 if (otherFacei != -1 && otherFacei > bFacei)
91 label own0 = faceOwner[face0];
92 label own1 = faceOwner[face1];
98 bool zoneFlip =
false;
102 const faceZone& fZone = faceZones[zoneID];
127 bool zoneFlip =
false;
131 const faceZone& fZone = faceZones[zoneID];
170 forAll(duplicates, bFacei)
172 if (duplicates[bFacei] != -1)
177 if (isA<processorPolyPatch>(patches[patchi]))
180 <<
"Duplicate face " << facei
181 <<
" is on a processorPolyPatch." 182 <<
"This is not allowed." <<
nl 200 forAll(duplicates, bFacei)
202 label otherFacei = duplicates[bFacei];
204 if (otherFacei != -1 && otherFacei > bFacei)
211 Pout<<
"Writing " << duplicateSet.size()
212 <<
" duplicate faces to faceSet " << duplicateSet.objectPath()
214 duplicateSet.
write();
223 int main(
int argc,
char *argv[])
227 "Detect faces that share points (baffles).\n" 228 "Merge them or duplicate the points." 236 "find baffles only, but do not merge or split them" 241 "topologically split duplicate surfaces" 272 findBaffles(mesh, boundaryFaces);
280 if (fields)
Info<<
"Reading geometric fields" <<
nl <<
endl;
295 Pout<<
"Topologically splitting duplicate surfaces" 296 <<
", i.e. duplicating points internal to duplicate surfaces." 306 pointDuplicator.setRefinement(
regionSide, meshMod);
310 Pout<<
"Merging duplicate faces." 314 labelList duplicates(findBaffles(mesh, boundaryFaces));
317 insertDuplicateMerge(mesh, duplicates, meshMod);
332 if (map().hasMotionPoints())
347 const labelList& pointMap = map().pointMap();
349 labelList nDupPerPoint(map().nOldPoints(), 0);
351 pointSet dupPoints(mesh,
"duplicatedPoints", 100);
355 label oldPointi = pointMap[pointi];
357 nDupPerPoint[oldPointi]++;
359 if (nDupPerPoint[oldPointi] > 1)
361 dupPoints.insert(map().reversePointMap()[oldPointi]);
362 dupPoints.insert(pointi);
366 Pout<<
"Writing " << dupPoints.size()
367 <<
" duplicated points to pointSet " 368 << dupPoints.objectPath() <<
nl <<
endl;
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Class containing data for face removal.
virtual tmp< scalarField > movePoints(const pointField &)
Move points, returns volumes swept by faces in motion.
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const word & name() const
Return name.
List of IOobjects with searching and retrieving facilities.
const faceZoneMesh & faceZones() const
Return face zone mesh.
Class describing modification of a face.
void off()
Switch the function objects off.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
label nInternalFaces() const
const boolList & flipMap() const
Return face flip map.
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool optionFound(const word &opt) const
Return true if the named option is found.
label whichFace(const label globalCellID) const
Helper function to re-direct to zone::localID(...)
Field reading functions for post-processing utilities.
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
Takes mesh with 'baffles' (= boundary faces sharing points). Determines for selected points on bounda...
Determines the 'side' for every face and connected to a singly-connected (through edges) region of fa...
const fileName & pointsInstance() const
Return the current instance directory for points.
virtual void updateMesh(const mapPolyMesh &mpm)
Update the mesh corresponding to given map.
A class for handling words, derived from string.
virtual const labelList & faceOwner() const
Return face owner.
virtual const faceList & faces() const
Return raw faces.
errorManip< error > abort(error &err)
void setInstance(const fileName &)
Set the instance for mesh files.
label whichZone(const label objectIndex) const
Given a global object index, return the zone it is in.
const functionObjectList & functionObjects() const
Return the list of function objects.
prefixOSstream Pout(cout, "Pout")
Direct mesh changes based on v1.3 polyTopoChange syntax.
static labelList findDuplicateFaces(const primitiveMesh &, const labelList &)
Helper routine to find baffles (two boundary faces using the.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
virtual Ostream & write(const token &)=0
Write next token to stream.
Mesh consisting of general polyhedral cells.
static void addBoolOption(const word &opt, const string &usage="")
Add to a bool option to validOptions with usage information.
A subset of mesh faces organised as a primitive patch.
static void addNote(const string &)
Add extra notes for the usage information.
autoPtr< mapPolyMesh > changeMesh(polyMesh &mesh, const bool inflate, const bool syncParallel=true, const bool orderCells=false, const bool orderPoints=false)
Inplace changes mesh without change of patches.
virtual bool write(const bool write=true) const
Write using setting from DB.
Foam::argList args(argc, argv)
label whichPatch(const label faceIndex) const
Return patch index for a given face label.
label setAction(const topoAction &action)
For compatibility with polyTopoChange: set topological action.