Go to the documentation of this file.
60 const word& patchName,
61 const word& groupName,
81 if (!groupName.empty() && !pp.
inGroup(groupName))
99 Info<<
"Patch '" << patchName
100 <<
"' already exists. Only "
101 <<
"moving patch faces - type will remain the same"
115 const bool flipFaceFlux,
116 const label newPatchI,
123 if (!modifiedFace[faceI])
141 modifiedFace[faceI] = 1;
170 const bool internalFacesOnly,
182 forAll(newMasterPatches, i)
193 if (!fZone.
flipMap()[zoneFaceI])
243 if (!fZone.
flipMap()[zoneFaceI])
297 label newPatchI = newMasterPatches[i];
299 if (pp.
coupled() && pbm[newPatchI].coupled())
304 else if (pp.
coupled() || !internalFacesOnly)
314 if (patchWarned.
insert(patchI))
317 <<
"Found boundary face (in patch "
319 <<
") in faceZone " << fZone.
name()
320 <<
" to convert to baffle patch "
321 << pbm[newPatchI].
name()
323 <<
" Run with -internalFacesOnly option"
324 <<
" if you don't wish to convert"
325 <<
" boundary faces." <<
endl;
349 int main(
int argc,
char *argv[])
353 "Makes internal faces into boundary faces.\n"
354 "Does not duplicate points."
362 runTime.functionObjects().off();
373 Switch internalFacesOnly(
false);
382 dict.
lookup(
"internalFacesOnly") >> internalFacesOnly;
411 if (internalFacesOnly)
413 Info<<
"Not converting faces on non-coupled patches." <<
nl <<
endl;
421 Info<<
"Reading geometric fields" <<
nl <<
endl;
460 forAll(selectors, selectorI)
462 const word&
name = selectors[selectorI].name();
487 forAll(selectors, selectorI)
489 const word&
name = selectors[selectorI].name();
492 selectors[selectorI].select(zoneID, faceToZoneID, faceToFlip);
497 forAll(faceToZoneID, faceI)
499 label zoneID = faceToZoneID[faceI];
506 forAll(selectors, selectorI)
508 const word&
name = selectors[selectorI].name();
511 label&
n = nFaces[zoneID];
515 forAll(faceToZoneID, faceI)
521 flip[
n] = faceToFlip[faceI];
527 <<
" at index " << zoneID
543 forAll(selectors, selectorI)
552 const word patchName(iter().
dict()[
"name"]);
553 bafflePatches.
insert(patchName);
558 const word masterName = selectors[selectorI].name() +
"_master";
559 bafflePatches.
insert(masterName);
560 const word slaveName = selectors[selectorI].name() +
"_slave";
561 bafflePatches.
insert(slaveName);
586 forAll(selectors, selectorI)
589 const word& groupName = selectors[selectorI].name();
596 const word patchName(iter().
dict()[
"name"]);
601 patchDict.
set(
"nFaces", 0);
602 patchDict.
set(
"startFace", 0);
609 addPatch(
mesh, patchName, groupName, patchDict);
613 Info<<
"Patch '" << patchName
614 <<
"' already exists. Only "
615 <<
"moving patch faces - type will remain the same"
623 const word masterName = groupName +
"_master";
624 const word slaveName = groupName +
"_slave";
626 word groupNameMaster = groupName;
627 word groupNameSlave = groupName;
631 patchDictMaster.set(
"nFaces", 0);
632 patchDictMaster.set(
"startFace", 0);
633 patchDictMaster.set(
"coupleGroup", groupName);
647 groupNameMaster = groupName +
"Group_master";
648 groupNameSlave = groupName +
"Group_slave";
649 patchDictMaster.set(
"coupleGroup", groupNameMaster);
650 patchDictSlave.set(
"coupleGroup", groupNameSlave);
653 addPatch(
mesh, masterName, groupNameMaster, patchDictMaster);
654 addPatch(
mesh, slaveName, groupNameSlave, patchDictSlave);
683 forAll(selectors, selectorI)
685 const word&
name = selectors[selectorI].name();
701 const word patchName(iter().
dict()[
"name"]);
705 newMasterPatches.
append(patchI);
709 newSlavePatches.
append(patchI);
716 const word masterName = selectors[selectorI].name() +
"_master";
719 const word slaveName = selectors[selectorI].name() +
"_slave";
740 <<
" faces into boundary faces in patches "
760 bool hasWarned =
false;
774 <<
"Setting field on boundary faces to zero." <<
endl
775 <<
"You might have to edit these fields." <<
endl;
789 forAll(selectors, selectorI)
798 const word patchName(iter().
dict()[
"name"]);
827 const word& groupName = selectors[selectorI].name();
829 if (patchSource.
found(
"patchFields"))
844 dict.
set(
"coupleGroup", groupName);
863 const word masterPatchName(groupName +
"_master");
864 const word slavePatchName(groupName +
"_slave");
890 if (map().hasMotionPoints())
900 Info<<
"Writing mesh to " << runTime.timeName() <<
endl;
Mapping class for a fvPatchField.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
const HashTable< labelList, word > & groupPatchIDs() const
Per patch group the patch indices.
static autoPtr< faceSelection > New(const word &name, const fvMesh &mesh, const dictionary &dict)
Return a reference to the selected faceSelection.
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
label findPatchID(const word &patchName) const
Find patch index given a name.
A class for handling words, derived from string.
#define forAllIter(Container, container, iter)
Iterate across all elements in the container object of type.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
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.
virtual bool coupled() const
Return true if this patch is geometrically coupled (i.e. faces and.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
Direct mesh changes based on v1.3 polyTopoChange syntax.
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
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.
virtual label sizeBeforeMapping() const
Return size of field before mapping.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
const faceZoneMesh & faceZones() const
Return face zone mesh.
virtual bool write() const
Write mesh using IO settings from time.
const word dictName("particleTrackDict")
const fileName & pointsInstance() const
Return the current instance directory for points.
bool checkParallelSync(const bool report=false) const
Check whether all procs have all patches and in same order. Return.
bool set(const label) const
Is element set.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
bool inGroup(const word &) const
Test if in group.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
const wordList & inGroups() const
Return the optional groups patch belongs to.
A subset of mesh faces organised as a primitive patch.
void append(const T &)
Append an element at the end of the list.
A patch is a list of labels that address the faces in the global face list.
virtual const labelList & faceOwner() const
Return face owner.
virtual void updateMesh(const mapPolyMesh &mpm)
Update mesh corresponding to the given map.
const word & name() const
Return name.
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...
A list of keyword definitions, which are a keyword followed by any number of values (e....
label nInternalFaces() const
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.
Mesh data needed to do the Finite Volume discretisation.
This boundary condition is not designed to be evaluated; it is assmued that the value is assigned via...
label whichFace(const label globalCellID) const
Helper function to re-direct to zone::localID(...)
const word & name() const
Return name.
label findZoneID(const word &zoneName) const
Find zone index given a name.
List< Key > sortedToc() const
Return the table of contents as a sorted list.
label start() const
Return start label of this patch in the polyMesh face list.
List of IOobjects with searching and retrieving facilities.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
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.
label setAction(const topoAction &action)
For compatibility with polyTopoChange: set topological action.
Helper routine to read fields.
Class holds all the necessary information for mapping fields associated with fvMesh.
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.
void setSize(const label)
Reset size of PtrList. If extending the PtrList, new entries are.
bool optionFound(const word &opt) const
Return true if the named option is found.
A face addition data class. A face can be inflated either from a point or from another face and can e...
A face is a list of labels corresponding to mesh vertices.
void clearAddressing()
Clear addressing.
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
Foam::argList args(argc, argv)
const boolList & flipMap() const
Return face flip map.
label index() const
Return the index of this zone in zone list.
bool checkParallelSync(const bool report=false) const
Check whether all procs have all zones and in same order. Return.
const word & name() const
Return name.
#define WarningInFunction
Report a warning using Foam::Warning.
IOobject dictIO(dictName, runTime.constant(), mesh, IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE)
word name(const complex &)
Return a string representation of a complex.
virtual const labelList & faceNeighbour() const
Return face neighbour.
void set(entry *)
Assign a new entry, overwrite any existing entry.