Go to the documentation of this file.
56 #include "indirectPrimitivePatch.H"
81 label otherFaceI = duplicates[bFaceI];
83 if (otherFaceI != -1 && otherFaceI > bFaceI)
90 label own0 = faceOwner[face0];
91 label own1 = faceOwner[face1];
97 bool zoneFlip =
false;
101 const faceZone& fZone = faceZones[zoneID];
126 bool zoneFlip =
false;
130 const faceZone& fZone = faceZones[zoneID];
169 forAll(duplicates, bFaceI)
171 if (duplicates[bFaceI] != -1)
176 if (isA<processorPolyPatch>(
patches[patchI]))
179 <<
"Duplicate face " << faceI
180 <<
" is on a processorPolyPatch."
181 <<
"This is not allowed." <<
nl
183 <<
" is on patch:" <<
patches[patchI].name()
199 forAll(duplicates, bFaceI)
201 label otherFaceI = duplicates[bFaceI];
203 if (otherFaceI != -1 && otherFaceI > bFaceI)
210 Pout<<
"Writing " << duplicateSet.size()
211 <<
" duplicate faces to faceSet " << duplicateSet.objectPath()
213 duplicateSet.
write();
222 int main(
int argc,
char *argv[])
226 "Detect faces that share points (baffles).\n"
227 "Merge them or duplicate the points."
235 "find baffles only, but do not merge or split them"
240 "topologically split duplicate surfaces"
245 runTime.functionObjects().off();
314 Pout<<
"Topologically splitting duplicate surfaces"
315 <<
", i.e. duplicating points internal to duplicate surfaces."
329 Pout<<
"Merging duplicate faces."
351 if (map().hasMotionPoints())
360 Pout<<
"Writing mesh to time " << runTime.timeName() <<
endl;
366 const labelList& pointMap = map().pointMap();
368 labelList nDupPerPoint(map().nOldPoints(), 0);
374 label oldPointI = pointMap[pointI];
376 nDupPerPoint[oldPointI]++;
378 if (nDupPerPoint[oldPointI] > 1)
380 dupPoints.
insert(map().reversePointMap()[oldPointI]);
385 Pout<<
"Writing " << dupPoints.
size()
386 <<
" duplicated points to pointSet "
Takes mesh with 'baffles' (= boundary faces sharing points). Determines for selected points on bounda...
A class for handling words, derived from string.
labelList findBaffles(const polyMesh &mesh, const labelList &boundaryFaces)
static void addNote(const string &)
Add extra notes for the usage information.
#define forAll(list, i)
Loop across all elements in list.
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.
wordList ReadFields(const typename GeoMesh::Mesh &mesh, const IOobjectList &objects, PtrList< GeometricField< Type, PatchField, GeoMesh > > &fields, const bool syncPar=true, const bool readOldTime=false)
Helper routine to read Geometric fields.
Direct mesh changes based on v1.3 polyTopoChange syntax.
static void addBoolOption(const word &opt, const string &usage="")
Add to a bool option to validOptions with usage information.
virtual bool write() const
Write using setting from DB.
Class describing modification of a face.
virtual tmp< scalarField > movePoints(const pointField &)
Move points, returns volumes swept by faces in motion.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void insertDuplicateMerge(const polyMesh &mesh, const labelList &duplicates, polyTopoChange &meshMod)
Mesh consisting of general polyhedral cells.
const faceZoneMesh & faceZones() const
Return face zone mesh.
fileName objectPath() const
Return complete path + object name.
virtual bool write() const
Write mesh using IO settings from time.
const fileName & pointsInstance() const
Return the current instance directory for points.
Determines the 'side' for every face and connected to a singly-connected (through edges) region of fa...
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
A subset of mesh faces organised as a primitive patch.
virtual Ostream & write(const token &)=0
Write next token to stream.
virtual const labelList & faceOwner() const
Return face owner.
virtual void updateMesh(const mapPolyMesh &mpm)
Update mesh corresponding to the given map.
int main(int argc, char *argv[])
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
label whichZone(const label objectIndex) const
Given a global object index, return the zone it is in.
label size() const
Return number of elements in table.
label nInternalFaces() const
static labelList findDuplicateFaces(const primitiveMesh &, const labelList &)
Helper routine to find baffles (two boundary faces using the.
label whichFace(const label globalCellID) const
Helper function to re-direct to zone::localID(...)
errorManip< error > abort(error &err)
List of IOobjects with searching and retrieving facilities.
void setRefinement(const localPointRegion ®ionSide, polyTopoChange &)
Play commands into polyTopoChange to duplicate points. Gets.
void setInstance(const fileName &)
Set the instance for mesh files.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
virtual const faceList & faces() const
Return raw faces.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
label setAction(const topoAction &action)
For compatibility with polyTopoChange: set topological action.
Helper routine to read fields.
prefixOSstream Pout(cout, "Pout")
Class containing data for face removal.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
bool insert(const Key &key)
Insert a new entry.
bool optionFound(const word &opt) const
Return true if the named option is found.
Foam::argList args(argc, argv)
const boolList & flipMap() const
Return face flip map.