79 if (!isA<processorPolyPatch>(pp))
88 oldToNew[
patchi] = newPatchi++;
98 if (isA<processorPolyPatch>(pp))
100 oldToNew[
patchi] = newPatchi++;
105 const label nKeepPatches = newPatchi;
108 if (nKeepPatches != bMesh.
size())
110 Info<< endl <<
"Removing zero-sized patches:" << endl <<
incrIndent;
115 if (oldToNew[
patchi] == -1)
118 <<
" type " << bMesh[
patchi].type()
121 oldToNew[
patchi] = newPatchi++;
141 const bool flipFaceFlux,
142 const label newPatchi,
148 if (!modifiedFace[facei])
167 modifiedFace[facei] = 1;
194 const bool internalFacesOnly,
197 const label newOwnerPatchi,
198 const label newNeighbourPatchi,
214 if (!fZone.
flipMap()[zoneFacei])
239 mesh.
faces()[facei].reverseFace(),
261 if (!fZone.
flipMap()[zoneFacei])
267 mesh.
faces()[facei].reverseFace(),
301 if (pp.
coupled() || !internalFacesOnly)
312 ? bMesh[newOwnerPatchi]
313 : bMesh[newNeighbourPatchi];
320 <<
"Face on coupled patch \"" << pp.
name()
321 <<
"\" selected for conversion to coupled " 322 <<
"patch \"" << newPp.
name() <<
"\". " 323 <<
"Conversion from coupled patch to coupled " 324 <<
"patch is not allowed." 351 int main(
int argc,
char *argv[])
355 "Makes internal faces into boundary faces.\n" 356 "Does not duplicate points." 365 runTime.functionObjects().off();
408 if (internalFacesOnly)
410 Info<<
"Not converting faces on non-coupled patches." <<
nl <<
endl;
415 if (fields)
Info<<
"Reading geometric fields" <<
nl <<
endl;
422 forAll(selectors, selectorI)
424 const word& name = selectors[selectorI].name();
447 forAll(selectors, selectorI)
449 const word& name = selectors[selectorI].name();
452 selectors[selectorI].select(zoneID, faceToZoneID, faceToFlip);
457 forAll(faceToZoneID, facei)
459 label zoneID = faceToZoneID[facei];
465 forAll(selectors, selectorI)
467 const word& name = selectors[selectorI].name();
470 label& n = nFaces[zoneID];
475 forAll(faceToZoneID, facei)
477 label zone = faceToZoneID[facei];
481 flip[
n] = faceToFlip[facei];
486 Info<<
"Created zone '" << name <<
"' with " 523 forAll(selectors, selectorI)
525 const word& groupName = selectors[selectorI].name();
527 selectors[selectorI].dict().optionalSubDict(
"patches");
529 forAll(patchEntryKeywords, i)
534 patchEntryKeywords[i],
543 Info<<
"Adding patch '" << patchName <<
"' to the mesh" <<
endl;
546 patchDict.
set(
"nFaces", 0);
547 patchDict.
set(
"startFace", 0);
561 if (!groupName.empty() && !pp.
inGroup(groupName))
579 Info<<
"Patch '" << patchName
580 <<
"' already exists in the mesh" <<
endl;
583 patchDict.
remove(
"patchFields");
585 if (!patchDict.empty())
588 <<
"Patch settings found in " << patchDict.
name()
589 <<
" for patch '" << patchName <<
"', but this patch " 590 <<
"already exists so these settings will not be used" 595 bafflePatches.
insert(patchName);
617 forAll(selectors, selectorI)
619 const word& groupName = selectors[selectorI].name();
624 selectors[selectorI].dict().optionalSubDict(
"patches");
627 forAll(patchEntryKeywords, i)
632 patchEntryKeywords[i],
642 const label nModified =
654 Info<<
"Converted " << nModified
655 <<
" faces into boundary faces on ";
656 if (newPatchIDs[0] == newPatchIDs[1])
658 Info<<
"patch '" << bMesh[newPatchIDs[0]].
name() <<
"'";
662 Info<<
"patches '" << bMesh[newPatchIDs[0]].
name()
663 <<
"' and '" << bMesh[newPatchIDs[1]].
name() <<
"'";
684 forAll(selectors, selectorI)
687 selectors[selectorI].dict().optionalSubDict(
"patches");
689 forAll(patchEntryKeywords, i)
694 patchEntryKeywords[i],
701 if (!bafflePatchFields.
found(patchName))
703 bafflePatchFields.
insert(patchName);
708 fvMeshTools::setPatchFields
717 if (patchDict.
found(
"patchFields"))
720 <<
"Patch field settings found in " << patchDict.
name()
721 <<
" for patch '" << patchName <<
"', but fields have " 722 <<
"already been set for this patch so these settings " 723 <<
"will not be used" <<
endl;
730 if (map().hasMotionPoints())
736 filterPatches(mesh, bafflePatches);
743 Info<<
"Writing mesh to " << runTime.timeName() <<
endl;
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
A HashTable with keys but without contents.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
label findZoneID(const word &zoneName) const
Find zone index given a name.
#define forAll(list, i)
Loop across all elements in list.
bool remove(const word &)
Remove an entry specified by keyword.
const entry & lookupEntryBackwardsCompatible(const wordList &, bool recursive, bool patternMatch) const
Find and return an entry data stream if present, trying a list.
autoPtr< polyTopoChangeMap > 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.
const word & name() const
Return name.
const word & name() const
Return name.
Ostream & indent(Ostream &os)
Indent stream.
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)
Class describing modification of a face.
A face is a list of labels corresponding to mesh vertices.
A 1D vector of objects of type <T> with a fixed size <Size>.
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.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
label nInternalFaces() const
virtual const labelList & faceNeighbour() const
Return face neighbour.
bool inGroup(const word &) const
Test if in group.
const boolList & flipMap() const
Return face flip map.
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool checkParallelSync(const bool report=false) const
Check whether all procs have all zones and in same order. Return.
bool optionFound(const word &opt) const
Return true if the named option is found.
A simple wrapper around bool so that it can be read as a word: true/false, on/off, yes/no, y/n, t/f, or none/any.
virtual const dictionary & dict() const =0
Return dictionary if this entry is a dictionary.
label findPatchID(const word &patchName) const
Find patch index given a name.
label whichFace(const label globalCellID) const
Helper function to re-direct to zone::localID(...)
Field reading functions for post-processing utilities.
const wordList & inGroups() const
Return the optional groups patch belongs to.
virtual bool write(const bool write=true) const
Write mesh using IO settings from time.
bool insert(const Key &key)
Insert a new entry.
IOdictionary systemDict(const word &dictName, const argList &args, const objectRegistry &ob, const word ®ionName=polyMesh::defaultRegion)
static bool constraintType(const word &pt)
Return true if the given type is a constraint type.
virtual void topoChange(const polyTopoChangeMap &map)
Update mesh corresponding to the given map.
A face addition data class. A face can be inflated either from a point or from another face and can e...
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
label index() const
Return the index of this zone in zone list.
const fileName & pointsInstance() const
Return the current instance directory for points.
virtual bool coupled() const
Return true if this patch is geometrically coupled (i.e. faces and.
const fileName & name() const
Return the dictionary name.
bool found(const Key &) const
Return true if hashedEntry is found in table.
A class for handling words, derived from string.
void append(const T &)
Append an element at the end of the list.
This boundary condition is not designed to be evaluated; it is assumed that the value is assigned via...
virtual const labelList & faceOwner() const
Return face owner.
virtual void setPoints(const pointField &)
Reset the points.
virtual const faceList & faces() const
Return raw faces.
void setSize(const label)
Reset size of PtrList. If extending the PtrList, new entries are.
bool checkParallelSync(const bool report=false) const
Check whether all procs have all patches and in same order. Return.
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
void setInstance(const fileName &)
Set the instance for mesh files.
static autoPtr< faceSelection > New(const word &name, const fvMesh &mesh, const dictionary &dict)
Return a reference to the selected faceSelection.
label size() const
Return the number of elements in the UPtrList.
List< word > wordList
A List of words.
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
#define WarningInFunction
Report a warning using Foam::Warning.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
const meshFaceZones & faceZones() const
Return face zones.
Mesh data needed to do the Finite Volume discretisation.
label index() const
Return the index of this patch in the boundaryMesh.
Direct mesh changes based on v1.3 polyTopoChange syntax.
label start() const
Return start label of this patch in the polyMesh face list.
void set(entry *)
Assign a new entry, overwrite any existing entry.
static autoPtr< polyPatch > New(const word &patchType, const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm)
Return a pointer to a new patch created on freestore from.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
A subset of mesh faces organised as a primitive patch.
static void addNote(const string &)
Add extra notes for the usage information.
A patch is a list of labels that address the faces in the global face list.
Foam::argList args(argc, argv)
Ostream & incrIndent(Ostream &os)
Increment the indent level.
void clearAddressing()
Clear addressing.
dictionary subOrEmptyDict(const word &, const bool mustRead=false) const
Find and return a sub-dictionary as a copy, or.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
label setAction(const topoAction &action)
For compatibility with polyTopoChange: set topological action.