Go to the documentation of this file.
87 void insertDuplicateMerge
101 label otherFacei = duplicates[bFacei];
103 if (otherFacei != -1 && otherFacei > bFacei)
107 label face0 = boundaryFaces[bFacei];
108 label face1 = boundaryFaces[otherFacei];
110 label own0 = faceOwner[face0];
111 label own1 = faceOwner[face1];
117 bool zoneFlip =
false;
146 bool zoneFlip =
false;
202 faceIDs[sz++] = pp.
start()+ppi;
206 if (faceIDs.size() != sz)
228 forAll(duplicates, bFacei)
230 if (duplicates[bFacei] != -1)
232 label facei = boundaryFaces[bFacei];
235 if (isA<processorPolyPatch>(
patches[patchi]))
238 <<
"Duplicate face " << facei
239 <<
" is on a processorPolyPatch."
240 <<
"This is not allowed." <<
nl
258 forAll(duplicates, bFacei)
260 label otherFacei = duplicates[bFacei];
262 if (otherFacei != -1 && otherFacei > bFacei)
264 duplicateSet.insert(boundaryFaces[bFacei]);
265 duplicateSet.insert(boundaryFaces[otherFacei]);
270 <<
" duplicate faces to faceSet " << duplicateSet.objectPath()
272 duplicateSet.
write();
279 int main(
int argc,
char *argv[])
283 "Detect faces that share points (baffles).\n"
284 "Merge them or duplicate the points."
293 "Specify a dictionary to read actions from"
298 "Find baffles only, but do not merge or split them"
303 "Topologically split duplicate surfaces"
315 const bool readDict =
args.
found(
"dict");
317 const bool overwrite =
args.
found(
"overwrite");
318 const bool detectOnly =
args.
found(
"detectOnly");
320 if (readDict && (
split || detectOnly))
323 <<
"Use of dictionary for settings not compatible with"
324 <<
" using command line arguments for \"split\""
348 Info<<
"Detecting baffles on " << detectPatchIDs.size()
360 Info<<
"Detecting baffles on " << mergePatchIDs.size()
372 Info<<
"Detecting baffles on " << splitPatchIDs.size()
395 if (detectPatchIDs.size())
397 findBaffles(
mesh, patchFaces(
mesh, detectPatchIDs));
446 if (mergePatchIDs.size())
448 Info<<
"Merging duplicate faces" <<
nl <<
endl;
453 const labelList boundaryFaces(patchFaces(
mesh, mergePatchIDs));
459 insertDuplicateMerge(
mesh, boundaryFaces, duplicates, meshMod);
473 if (map().hasMotionPoints())
487 if (splitPatchIDs.size())
489 Info<<
"Topologically splitting duplicate surfaces"
490 <<
", i.e. duplicating points internal to duplicate surfaces"
499 sz +=
patches[splitPatchIDs[i]].nPoints();
509 label pointi =
mp[mpi];
510 if (isCandidate.set(pointi))
512 candidates.
append(pointi);
529 pointDuplicator.setRefinement(
regionSide, meshMod);
543 if (map().hasMotionPoints())
559 const labelList& pointMap = map().pointMap();
567 label oldPointi = pointMap[pointi];
569 nDupPerPoint[oldPointi]++;
571 if (nDupPerPoint[oldPointi] > 1)
573 dupPoints.insert(map().reversePointMap()[oldPointi]);
574 dupPoints.insert(pointi);
579 <<
" duplicated points to pointSet "
580 << dupPoints.objectPath() <<
nl <<
endl;
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
const dimensionedScalar mp
Takes mesh with 'baffles' (= boundary faces sharing points). Determines for selected points on bounda...
A class for handling words, derived from Foam::string.
const boolList & flipMap() const noexcept
virtual bool write(const bool valid=true) const
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO.
wordList ReadFields(const typename GeoMesh::Mesh &mesh, const IOobjectList &objects, PtrList< GeometricField< Type, PatchField, GeoMesh >> &fields, const bool syncPar=true, const bool readOldTime=false)
static constexpr const zero Zero
bool found(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
const word dictName("faMeshDefinition")
static word timeName(const scalar t, const int precision=precision_)
Direct mesh changes based on v1.3 polyTopoChange syntax.
static void addNote(const string ¬e)
Class describing modification of a face.
virtual tmp< scalarField > movePoints(const pointField &)
const polyBoundaryMesh & boundaryMesh() const
Ostream & endl(Ostream &os)
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Mesh consisting of general polyhedral cells.
label nPoints() const noexcept
void setCapacity(const label len)
const fileName & pointsInstance() const
Determines the 'side' for every face and connected to a singly-connected (through edges) region of fa...
static void noFunctionObjects(bool addWithOption=false)
A subset of mesh faces organised as a primitive patch.
A patch is a list of labels that address the faces in the global face list.
DynamicList< T, SizeMin > & append(const T &val)
virtual const labelList & faceOwner() const
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
virtual void updateMesh(const mapPolyMesh &mpm)
label nBoundaryFaces() const noexcept
const faceZoneMesh & faceZones() const noexcept
label whichPatch(const label faceIndex) const
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
autoPtr< mapPolyMesh > changeMesh(polyMesh &mesh, const labelUList &patchMap, const bool inflate, const bool syncParallel=true, const bool orderCells=false, const bool orderPoints=false)
static bool split(const std::string &line, std::string &key, std::string &val)
label whichZone(const label objectIndex) const
static labelList findDuplicateFaces(const primitiveMesh &, const labelList &)
const labelIOList & zoneID
virtual bool write(const token &tok)=0
label whichFace(const label globalCellID) const
errorManip< error > abort(error &err)
List of IOobjects with searching and retrieving facilities.
errorManipArg< error, int > exit(error &err, const int errNo=1)
const word & name() const noexcept
static void addBoolOption(const word &optName, const string &usage="", bool advanced=false)
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
virtual const faceList & faces() const
#define FatalErrorInFunction
label setAction(const topoAction &action)
Field reading functions for post-processing utilities.
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...
static void removeFiles(const polyMesh &mesh)
labelList identity(const label len, label start=0)
A List of wordRe with additional matching capabilities.
labelHashSet patchSet(const UList< wordRe > &patchNames, const bool warnNotFound=true, const bool useGroups=true) const
const polyBoundaryMesh & patches
static void addOption(const word &optName, const string ¶m="", const string &usage="", bool advanced=false)
Foam::argList args(argc, argv)
static void removeFiles(const polyMesh &)
void setInstance(const fileName &instance, const IOobject::writeOption wOpt=IOobject::AUTO_WRITE)
bool found(const word &optName) const