83 Info<<
"Reusing existing pointZone " 85 <<
" at index " << zoneID <<
endl;
90 zoneID = pointZones.
size();
91 Info<<
"Adding pointZone " << name <<
" at index " << zoneID <<
endl;
117 <<
" at index " << zoneID <<
endl;
122 zoneID = faceZones.
size();
123 Info<<
"Adding faceZone " << name <<
" at index " << zoneID <<
endl;
150 <<
" at index " << zoneID <<
endl;
155 zoneID = cellZones.
size();
156 Info<<
"Adding cellZone " << name <<
" at index " << zoneID <<
endl;
183 <<
"Cannot find patch " << name << endl
184 <<
"It should be present and of non-zero size" << endl
185 <<
"Valid patches are " << bMesh.
names()
189 if (bMesh[patchi].empty())
192 <<
"Patch " << name <<
" is present but zero size" 199 int main(
int argc,
char *argv[])
203 "Merge the faces on the specified patches (if geometrically possible)\n" 204 "so the faces become internal.\n" 205 "Integral matching is used when the options -partial and -perfect are " 215 "do not update fields" 224 "couple partially overlapping patches (optional)" 229 "couple perfectly aligned patches (optional)" 235 "dictionary file with tolerances" 240 runTime.functionObjects().off();
245 const word masterPatchName =
args[1];
246 const word slavePatchName =
args[2];
253 if (partialCover && perfectCover)
256 <<
"Cannot supply both partial and perfect." << endl
257 <<
"Use perfect match option if the patches perfectly align" 258 <<
" (both vertex positions and face centres)" << endl
263 const word mergePatchName(masterPatchName + slavePatchName);
264 const word cutZoneName(mergePatchName +
"CutFaceZone");
270 Info<<
"Coupling partially overlapping patches " 271 << masterPatchName <<
" and " << slavePatchName <<
nl 272 <<
"Resulting internal faces will be in faceZone " << cutZoneName
274 <<
"Any uncovered faces will remain in their patch" 279 else if (perfectCover)
281 Info<<
"Coupling perfectly aligned patches " 282 << masterPatchName <<
" and " << slavePatchName <<
nl 283 <<
"Resulting (internal) faces will be in faceZone " << cutZoneName
285 <<
"Note: both patches need to align perfectly." <<
nl 287 <<
" positions and the face centres need to align to within" <<
nl 288 <<
"a tolerance given by the minimum edge length on the patch" 293 Info<<
"Coupling patches " << masterPatchName <<
" and " 294 << slavePatchName <<
nl 295 <<
"Resulting (internal) faces will be in faceZone " << cutZoneName
297 <<
"Note: the overall area covered by both patches should be" 298 <<
" identical (\"integral\" interface)." << endl
299 <<
"If this is not the case use the -partial option" <<
nl <<
endl;
317 slidingTolerances += toleranceFile;
334 isf[i] = masterPatch.start() + i;
347 label cutZoneID = addFaceZone(mesh, cutZoneName);
349 mesh.
faceZones()[cutZoneID].resetAddressing
372 label pointZoneID = addPointZone(mesh, mergePatchName +
"CutPointZone");
375 label masterZoneID = addFaceZone(mesh, mergePatchName +
"MasterZone");
377 mesh.
faceZones()[masterZoneID].resetAddressing
390 osf[i] = slavePatch.
start() + i;
393 label slaveZoneID = addFaceZone(mesh, mergePatchName +
"SlaveZone");
394 mesh.
faceZones()[slaveZoneID].resetAddressing
401 label cutZoneID = addFaceZone(mesh, cutZoneName);
402 mesh.
faceZones()[cutZoneID].resetAddressing
418 mergePatchName +
"MasterZone",
419 mergePatchName +
"SlaveZone",
420 mergePatchName +
"CutPointZone",
439 if (fields)
Info<<
"Reading geometric fields" <<
nl <<
endl;
459 stitcher.instance() = oldInstance;
462 Info<<
nl <<
"Writing polyMesh to time " << runTime.timeName() <<
endl;
469 !runTime.objectRegistry::writeObject
471 runTime.writeFormat(),
473 runTime.writeCompression(),
479 <<
"Failed writing polyMesh."
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
label findZoneID(const word &zoneName) const
Find zone index given a name.
#define forAll(list, i)
Loop across all elements in list.
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
const word & name() const
Return name.
bool set(const label) const
Is element set.
List of IOobjects with searching and retrieving facilities.
errorManipArg< error, int > exit(error &err, const int errNo=1)
const meshCellZones & cellZones() const
Return cell zones.
A list of keyword definitions, which are a keyword followed by any number of values (e...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
DynamicID< meshPointZones > pointZoneID
Foam::pointZoneID.
static unsigned int defaultPrecision()
Return the default precision.
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool optionFound(const word &opt) const
Return true if the named option is found.
label findPatchID(const word &patchName) const
Find patch index given a name.
static void noParallel()
Remove the parallel options.
static SLList< string > validArgs
A list of valid (mandatory) arguments.
Field reading functions for post-processing utilities.
const meshPointZones & pointZones() const
Return point zones.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
List< bool > boolList
Bool container classes.
const fileName & pointsInstance() const
Return the current instance directory for points.
const Foam::HashTable< string > & options() const
Return options.
List of mesh modifiers defining the mesh dynamics.
A class for handling words, derived from string.
wordList names() const
Return a list of patch names.
static void addOption(const word &opt, const string ¶m="", const string &usage="")
Add to an option to validOptions with usage information.
List< label > labelList
A List of labels.
void setSize(const label)
Reset size of PtrList. If extending the PtrList, new entries are.
Sliding interface mesh modifier. Given two face zones, couple the master and slave side using a cutti...
const pointField & preMotionPoints() const
Pre-motion point positions.
typeOfMatch
Type of match.
void setInstance(const fileName &)
Set the instance for mesh files.
label size() const
Return the number of elements in the UPtrList.
A subset of mesh points. The labels of points in the zone can be obtained from the addressing() list...
static const versionNumber currentVersion
Current version number.
const meshFaceZones & faceZones() const
Return face zones.
label start() const
Return start label of this patch in the polyMesh face list.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
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.
Hack of attachDetach to couple patches when they perfectly align. Does not decouple. Used by stitchMesh app. Does geometric matching.
virtual bool write(const bool write=true) const
Write using setting from DB.
A patch is a list of labels that address the faces in the global face list.
virtual void setPoints(const pointField &)
Reset the points.
Foam::argList args(argc, argv)
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
void clearAddressing()
Clear addressing.