61 const word& patchName,
62 const word& groupName,
82 if (!groupName.empty() && !pp.
inGroup(groupName))
100 Info<<
"Patch '" << patchName
101 <<
"' already exists. Only " 102 <<
"moving patch faces - type will remain the same" 127 if (!isA<processorPolyPatch>(pp))
131 isA<coupledPolyPatch>(pp)
137 oldToNew[
patchi] = newPatchi++;
146 if (isA<processorPolyPatch>(pp))
148 oldToNew[
patchi] = newPatchi++;
153 const label nKeepPatches = newPatchi;
156 if (nKeepPatches != pbm.
size())
159 <<
"Removing zero-sized patches:" << endl <<
incrIndent;
163 if (oldToNew[patchi] == -1)
166 <<
" type " << pbm[
patchi].type()
167 <<
" at position " << patchi <<
endl;
168 oldToNew[
patchi] = newPatchi++;
185 const bool flipFaceFlux,
186 const label newPatchi,
193 if (!modifiedFace[facei])
211 modifiedFace[facei] = 1;
240 const bool internalFacesOnly,
252 forAll(newMasterPatches, i)
263 if (!fZone.
flipMap()[zoneFacei])
288 mesh.
faces()[facei].reverseFace(),
313 if (!fZone.
flipMap()[zoneFacei])
319 mesh.
faces()[facei].reverseFace(),
367 const label newMasterPatchi = newMasterPatches[i];
368 const label newSlavePatchi = newSlavePatches[i];
374 pbm[newMasterPatchi].coupled()
375 || pbm[newSlavePatchi].coupled()
382 else if (pp.
coupled() || !internalFacesOnly)
392 if (patchWarned.insert(patchi))
395 <<
"Found boundary face (in patch " 397 <<
") in faceZone " << fZone.
name()
398 <<
" to convert to baffle patches " 399 << pbm[newMasterPatchi].
name() <<
"/" 400 << pbm[newSlavePatchi].
name()
402 <<
" Set internalFacesOnly to true in the" 403 <<
" createBaffles control dictionary if you" 404 <<
" don't wish to convert boundary faces." 432 int main(
int argc,
char *argv[])
436 "Makes internal faces into boundary faces.\n" 437 "Does not duplicate points." 456 Switch internalFacesOnly(
false);
465 dict.
lookup(
"internalFacesOnly") >> internalFacesOnly;
494 if (internalFacesOnly)
496 Info<<
"Not converting faces on non-coupled patches." <<
nl <<
endl;
541 forAll(selectors, selectorI)
543 const word& name = selectors[selectorI].name();
568 forAll(selectors, selectorI)
570 const word& name = selectors[selectorI].name();
573 selectors[selectorI].select(zoneID, faceToZoneID, faceToFlip);
578 forAll(faceToZoneID, facei)
580 label zoneID = faceToZoneID[facei];
587 forAll(selectors, selectorI)
589 const word& name = selectors[selectorI].name();
592 label& n = nFaces[zoneID];
596 forAll(faceToZoneID, facei)
598 label zone = faceToZoneID[facei];
602 flip[
n] = faceToFlip[facei];
607 Info<<
"Created zone " << name
608 <<
" at index " << zoneID
609 <<
" with " << n <<
" faces" <<
endl;
624 forAll(selectors, selectorI)
626 const dictionary& dict = selectors[selectorI].dict();
628 if (dict.
found(
"patches"))
633 const word patchName(iter().
dict()[
"name"]);
634 bafflePatches.
insert(patchName);
639 const word masterName = selectors[selectorI].name() +
"_master";
640 bafflePatches.
insert(masterName);
641 const word slaveName = selectors[selectorI].name() +
"_slave";
642 bafflePatches.
insert(slaveName);
667 forAll(selectors, selectorI)
669 const dictionary& dict = selectors[selectorI].dict();
670 const word& groupName = selectors[selectorI].name();
672 if (dict.
found(
"patches"))
677 const word patchName(iter().
dict()[
"name"]);
682 patchDict.
set(
"nFaces", 0);
683 patchDict.
set(
"startFace", 0);
690 addPatch(mesh, patchName, groupName, patchDict);
694 Info<<
"Patch '" << patchName
695 <<
"' already exists. Only " 696 <<
"moving patch faces - type will remain the same" 704 const word masterName = groupName +
"_master";
705 const word slaveName = groupName +
"_slave";
707 word groupNameMaster = groupName;
708 word groupNameSlave = groupName;
712 patchDictMaster.set(
"nFaces", 0);
713 patchDictMaster.set(
"startFace", 0);
714 patchDictMaster.set(
"coupleGroup", groupName);
728 groupNameMaster = groupName +
"Group_master";
729 groupNameSlave = groupName +
"Group_slave";
730 patchDictMaster.set(
"coupleGroup", groupNameMaster);
731 patchDictSlave.set(
"coupleGroup", groupNameSlave);
734 addPatch(mesh, masterName, groupNameMaster, patchDictMaster);
735 addPatch(mesh, slaveName, groupNameSlave, patchDictSlave);
764 forAll(selectors, selectorI)
766 const word& name = selectors[selectorI].name();
770 const dictionary& dict = selectors[selectorI].dict();
775 if (dict.
found(
"patches"))
782 const word patchName(iter().
dict()[
"name"]);
786 newMasterPatches.
append(patchi);
790 newSlavePatches.
append(patchi);
797 const word masterName = selectors[selectorI].name() +
"_master";
800 const word slaveName = selectors[selectorI].name() +
"_slave";
821 <<
" faces into boundary faces in patches " 841 bool hasWarned =
false;
855 <<
"Setting field on boundary faces to zero." << endl
856 <<
"You might have to edit these fields." <<
endl;
870 forAll(selectors, selectorI)
872 const dictionary& dict = selectors[selectorI].dict();
873 if (dict.
found(
"patches"))
879 const word patchName(iter().
dict()[
"name"]);
890 fvMeshTools::setPatchFields
908 const word& groupName = selectors[selectorI].name();
910 if (patchSource.
found(
"patchFields"))
925 dict.
set(
"coupleGroup", groupName);
934 fvMeshTools::setPatchFields
944 const word masterPatchName(groupName +
"_master");
945 const word slavePatchName(groupName +
"_slave");
950 fvMeshTools::setPatchFields
957 fvMeshTools::setPatchFields
971 if (map().hasMotionPoints())
978 filterPatches(mesh, bafflePatches);
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
bool checkParallelSync(const bool report=false) const
Check whether all procs have all zones and in same order. Return.
virtual label sizeBeforeMapping() const
Return size of field before mapping.
A HashTable with keys but without contents.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
wordList ReadFields(const Mesh &mesh, const IOobjectList &objects, PtrList< GeoField > &fields, const bool syncPar=true)
Read all fields of the specified type.
#define forAll(list, i)
Loop across all elements in list.
void clearAddressing()
Clear addressing.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
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.
const faceZoneMesh & faceZones() const
Return face zone mesh.
Class describing modification of a face.
A face is a list of labels corresponding to mesh vertices.
void off()
Switch the function objects off.
A list of keyword definitions, which are a keyword followed by any number of values (e...
label nInternalFaces() const
virtual const labelList & faceNeighbour() const
Return face neighbour.
virtual bool write(const bool valid=true) const
Write mesh using IO settings from time.
#define forAllIter(Container, container, iter)
Iterate across all elements in the container object of type.
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 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.
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.
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
const wordList & inGroups() const
Return the optional groups patch belongs to.
bool insert(const Key &key)
Insert a new entry.
Class holds all the necessary information for mapping fields associated with fvMesh.
A face addition data class. A face can be inflated either from a point or from another face and can e...
multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
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 void updateMesh(const mapPolyMesh &mpm)
Update mesh corresponding to the given map.
virtual bool coupled() const
Return true if this patch is geometrically coupled (i.e. faces and.
label findZoneID(const word &zoneName) const
Find zone index given a 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 assmued that the value is assigned via...
virtual const labelList & faceOwner() const
Return face owner.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
const word dictName("particleTrackDict")
const word & name() const
Return name.
virtual const faceList & faces() const
Return raw faces.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
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.
IOobject dictIO(dictName, runTime.constant(), mesh, IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE)
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.
virtual tmp< scalarField > movePoints(const pointField &)
Move points, returns volumes swept by faces in motion.
label size() const
Return the number of elements in the UPtrList.
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
const functionObjectList & functionObjects() const
Return the list of function objects.
#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...
Mesh data needed to do the Finite Volume discretisation.
List< Key > sortedToc() const
Return the table of contents as a sorted list.
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.
Mapping class for a fvPatchField.
static void addNote(const string &)
Add extra notes for the usage information.
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.
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.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
const HashTable< labelList, word > & groupPatchIDs() const
Per patch group the patch indices.
label setAction(const topoAction &action)
For compatibility with polyTopoChange: set topological action.