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 label newPatchi = newMasterPatches[i];
369 if (pp.
coupled() && pbm[newPatchi].coupled())
374 else if (pp.
coupled() || !internalFacesOnly)
384 if (patchWarned.insert(patchi))
387 <<
"Found boundary face (in patch " 389 <<
") in faceZone " << fZone.
name()
390 <<
" to convert to baffle patch " 391 << pbm[newPatchi].
name()
393 <<
" Run with -internalFacesOnly option" 394 <<
" if you don't wish to convert" 395 <<
" boundary faces." <<
endl;
419 int main(
int argc,
char *argv[])
423 "Makes internal faces into boundary faces.\n" 424 "Does not duplicate points." 432 runTime.functionObjects().off();
443 Switch internalFacesOnly(
false);
452 dict.
lookup(
"internalFacesOnly") >> internalFacesOnly;
481 if (internalFacesOnly)
483 Info<<
"Not converting faces on non-coupled patches." <<
nl <<
endl;
491 Info<<
"Reading geometric fields" <<
nl <<
endl;
493 if (!noFields)
ReadFields(mesh, objects, vsFlds);
496 if (!noFields)
ReadFields(mesh, objects, vvFlds);
499 if (!noFields)
ReadFields(mesh, objects, vstFlds);
502 if (!noFields)
ReadFields(mesh, objects, vsymtFlds);
505 if (!noFields)
ReadFields(mesh, objects, vtFlds);
510 if (!noFields)
ReadFields(mesh, objects, ssFlds);
513 if (!noFields)
ReadFields(mesh, objects, svFlds);
516 if (!noFields)
ReadFields(mesh, objects, sstFlds);
519 if (!noFields)
ReadFields(mesh, objects, ssymtFlds);
522 if (!noFields)
ReadFields(mesh, objects, stFlds);
530 forAll(selectors, selectorI)
532 const word& name = selectors[selectorI].name();
557 forAll(selectors, selectorI)
559 const word& name = selectors[selectorI].name();
562 selectors[selectorI].select(zoneID, faceToZoneID, faceToFlip);
567 forAll(faceToZoneID, facei)
569 label zoneID = faceToZoneID[facei];
576 forAll(selectors, selectorI)
578 const word& name = selectors[selectorI].name();
581 label& n = nFaces[zoneID];
585 forAll(faceToZoneID, facei)
587 label zone = faceToZoneID[facei];
591 flip[
n] = faceToFlip[facei];
596 Info<<
"Created zone " << name
597 <<
" at index " << zoneID
598 <<
" with " << n <<
" faces" <<
endl;
613 forAll(selectors, selectorI)
615 const dictionary& dict = selectors[selectorI].dict();
617 if (dict.
found(
"patches"))
622 const word patchName(iter().
dict()[
"name"]);
623 bafflePatches.
insert(patchName);
628 const word masterName = selectors[selectorI].name() +
"_master";
629 bafflePatches.
insert(masterName);
630 const word slaveName = selectors[selectorI].name() +
"_slave";
631 bafflePatches.
insert(slaveName);
656 forAll(selectors, selectorI)
658 const dictionary& dict = selectors[selectorI].dict();
659 const word& groupName = selectors[selectorI].name();
661 if (dict.
found(
"patches"))
666 const word patchName(iter().
dict()[
"name"]);
671 patchDict.
set(
"nFaces", 0);
672 patchDict.
set(
"startFace", 0);
679 addPatch(mesh, patchName, groupName, patchDict);
683 Info<<
"Patch '" << patchName
684 <<
"' already exists. Only " 685 <<
"moving patch faces - type will remain the same" 693 const word masterName = groupName +
"_master";
694 const word slaveName = groupName +
"_slave";
696 word groupNameMaster = groupName;
697 word groupNameSlave = groupName;
701 patchDictMaster.set(
"nFaces", 0);
702 patchDictMaster.set(
"startFace", 0);
703 patchDictMaster.set(
"coupleGroup", groupName);
717 groupNameMaster = groupName +
"Group_master";
718 groupNameSlave = groupName +
"Group_slave";
719 patchDictMaster.set(
"coupleGroup", groupNameMaster);
720 patchDictSlave.set(
"coupleGroup", groupNameSlave);
723 addPatch(mesh, masterName, groupNameMaster, patchDictMaster);
724 addPatch(mesh, slaveName, groupNameSlave, patchDictSlave);
753 forAll(selectors, selectorI)
755 const word& name = selectors[selectorI].name();
759 const dictionary& dict = selectors[selectorI].dict();
764 if (dict.
found(
"patches"))
771 const word patchName(iter().
dict()[
"name"]);
775 newMasterPatches.
append(patchi);
779 newSlavePatches.
append(patchi);
786 const word masterName = selectors[selectorI].name() +
"_master";
789 const word slaveName = selectors[selectorI].name() +
"_slave";
810 <<
" faces into boundary faces in patches " 830 bool hasWarned =
false;
844 <<
"Setting field on boundary faces to zero." << endl
845 <<
"You might have to edit these fields." <<
endl;
859 forAll(selectors, selectorI)
861 const dictionary& dict = selectors[selectorI].dict();
862 if (dict.
found(
"patches"))
868 const word patchName(iter().
dict()[
"name"]);
879 fvMeshTools::setPatchFields
897 const word& groupName = selectors[selectorI].name();
899 if (patchSource.
found(
"patchFields"))
914 dict.
set(
"coupleGroup", groupName);
923 fvMeshTools::setPatchFields
933 const word masterPatchName(groupName +
"_master");
934 const word slavePatchName(groupName +
"_slave");
939 fvMeshTools::setPatchFields
946 fvMeshTools::setPatchFields
960 if (map().hasMotionPoints())
967 filterPatches(mesh, bafflePatches);
975 Info<<
"Writing mesh to " << runTime.timeName() <<
endl;
A HashTable with keys but without contents.
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.
Ostream & indent(Ostream &os)
Indent stream.
List of IOobjects with searching and retrieving facilities.
bool checkParallelSync(const bool report=false) const
Check whether all procs have all patches and in same order. Return.
const boolList & flipMap() const
Return face flip map.
Class describing modification of a face.
A face is a list of labels corresponding to mesh vertices.
label index() const
Return the index of this zone in zone list.
A list of keyword definitions, which are a keyword followed by any number of values (e...
#define forAllIter(Container, container, iter)
Iterate across all elements in the container object of type.
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
Ostream & endl(Ostream &os)
Add newline and flush stream.
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.
Field reading functions for post-processing utilities.
bool insert(const Key &key)
Insert a new entry.
Class holds all the necessary information for mapping fields associated with fvMesh.
bool checkParallelSync(const bool report=false) const
Check whether all procs have all zones and in same order. Return.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
A face addition data class. A face can be inflated either from a point or from another face and can e...
bool inGroup(const word &) const
Test if in group.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
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.
virtual label sizeBeforeMapping() const
Return size of field before mapping.
virtual void updateMesh(const mapPolyMesh &mpm)
Update mesh corresponding to the given map.
label start() const
Return start label of this patch in the polyMesh face list.
bool optionFound(const word &opt) const
Return true if the named option is found.
virtual bool coupled() const
Return true if this patch is geometrically coupled (i.e. faces and.
A class for handling words, derived from string.
void append(const T &)
Append an element at the end of the list.
bool set(const label) const
Is element set.
This boundary condition is not designed to be evaluated; it is assmued that the value is assigned via...
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
const word & name() const
Return name.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
void setSize(const label)
Reset size of PtrList. If extending the PtrList, new entries are.
bool found(const Key &) const
Return true if hashedEntry is found in table.
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
const HashTable< labelList, word > & groupPatchIDs() const
Per patch group the patch indices.
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.
virtual const labelList & faceNeighbour() const
Return face neighbour.
#define WarningInFunction
Report a warning using Foam::Warning.
word dictName("noiseDict")
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
const fileName & pointsInstance() const
Return the current instance directory for points.
List< Key > sortedToc() const
Return the table of contents as a sorted list.
Mesh data needed to do the Finite Volume discretisation.
Direct mesh changes based on v1.3 polyTopoChange syntax.
void set(entry *)
Assign a new entry, overwrite any existing entry.
const faceZoneMesh & faceZones() const
Return face zone mesh.
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.
const wordList & inGroups() const
Return the optional groups patch belongs to.
virtual const labelList & faceOwner() const
Return face owner.
A patch is a list of labels that address the faces in the global face list.
virtual const faceList & faces() const
Return raw faces.
Foam::argList args(argc, argv)
Ostream & incrIndent(Ostream &os)
Increment the indent level.
label findPatchID(const word &patchName) const
Find patch index given a name.
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
label nInternalFaces() const
virtual bool write() const
Write mesh using IO settings from time.
const word & name() const
Return name.
label size() const
Return the number of elements in the UPtrList.
label setAction(const topoAction &action)
For compatibility with polyTopoChange: set topological action.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.