62 const word& patchName,
63 const word& groupName,
83 if (!groupName.empty() && !pp.
inGroup(groupName))
101 Info<<
"Patch '" << patchName
102 <<
"' already exists. Only " 103 <<
"moving patch faces - type will remain the same" 128 if (!isA<processorPolyPatch>(pp))
132 isA<coupledPolyPatch>(pp)
138 oldToNew[
patchi] = newPatchi++;
147 if (isA<processorPolyPatch>(pp))
149 oldToNew[
patchi] = newPatchi++;
154 const label nKeepPatches = newPatchi;
157 if (nKeepPatches != pbm.
size())
160 <<
"Removing zero-sized patches:" << endl <<
incrIndent;
164 if (oldToNew[patchi] == -1)
167 <<
" type " << pbm[
patchi].type()
168 <<
" at position " << patchi <<
endl;
169 oldToNew[
patchi] = newPatchi++;
186 const bool flipFaceFlux,
187 const label newPatchi,
194 if (!modifiedFace[facei])
212 modifiedFace[facei] = 1;
241 const bool internalFacesOnly,
253 forAll(newMasterPatches, i)
264 if (!fZone.
flipMap()[zoneFacei])
289 mesh.
faces()[facei].reverseFace(),
314 if (!fZone.
flipMap()[zoneFacei])
320 mesh.
faces()[facei].reverseFace(),
368 const label newMasterPatchi = newMasterPatches[i];
369 const label newSlavePatchi = newSlavePatches[i];
375 pbm[newMasterPatchi].coupled()
376 || pbm[newSlavePatchi].coupled()
383 else if (pp.
coupled() || !internalFacesOnly)
393 if (patchWarned.insert(patchi))
396 <<
"Found boundary face (in patch " 398 <<
") in faceZone " << fZone.
name()
399 <<
" to convert to baffle patches " 400 << pbm[newMasterPatchi].
name() <<
"/" 401 << pbm[newSlavePatchi].
name()
403 <<
" Set internalFacesOnly to true in the" 404 <<
" createBaffles control dictionary if you" 405 <<
" don't wish to convert boundary faces." 433 int main(
int argc,
char *argv[])
437 "Makes internal faces into boundary faces.\n" 438 "Does not duplicate points." 453 Switch internalFacesOnly(
false);
461 dict.
lookup(
"internalFacesOnly") >> internalFacesOnly;
490 if (internalFacesOnly)
492 Info<<
"Not converting faces on non-coupled patches." <<
nl <<
endl;
509 forAll(selectors, selectorI)
511 const word& name = selectors[selectorI].name();
536 forAll(selectors, selectorI)
538 const word& name = selectors[selectorI].name();
541 selectors[selectorI].select(zoneID, faceToZoneID, faceToFlip);
546 forAll(faceToZoneID, facei)
548 label zoneID = faceToZoneID[facei];
555 forAll(selectors, selectorI)
557 const word& name = selectors[selectorI].name();
560 label& n = nFaces[zoneID];
564 forAll(faceToZoneID, facei)
566 label zone = faceToZoneID[facei];
570 flip[
n] = faceToFlip[facei];
575 Info<<
"Created zone " << name
576 <<
" at index " << zoneID
577 <<
" with " << n <<
" faces" <<
endl;
592 forAll(selectors, selectorI)
594 const dictionary& dict = selectors[selectorI].dict();
596 if (dict.
found(
"patches"))
601 const word patchName(iter().
dict()[
"name"]);
602 bafflePatches.
insert(patchName);
607 const word masterName = selectors[selectorI].name() +
"_master";
608 bafflePatches.
insert(masterName);
609 const word slaveName = selectors[selectorI].name() +
"_slave";
610 bafflePatches.
insert(slaveName);
635 forAll(selectors, selectorI)
637 const dictionary& dict = selectors[selectorI].dict();
638 const word& groupName = selectors[selectorI].name();
640 if (dict.
found(
"patches"))
645 const word patchName(iter().
dict()[
"name"]);
650 patchDict.
set(
"nFaces", 0);
651 patchDict.
set(
"startFace", 0);
658 addPatch(mesh, patchName, groupName, patchDict);
662 Info<<
"Patch '" << patchName
663 <<
"' already exists. Only " 664 <<
"moving patch faces - type will remain the same" 672 const word masterName = groupName +
"_master";
673 const word slaveName = groupName +
"_slave";
675 word groupNameMaster = groupName;
676 word groupNameSlave = groupName;
680 patchDictMaster.set(
"nFaces", 0);
681 patchDictMaster.set(
"startFace", 0);
682 patchDictMaster.set(
"coupleGroup", groupName);
696 groupNameMaster = groupName +
"Group_master";
697 groupNameSlave = groupName +
"Group_slave";
698 patchDictMaster.set(
"coupleGroup", groupNameMaster);
699 patchDictSlave.set(
"coupleGroup", groupNameSlave);
702 addPatch(mesh, masterName, groupNameMaster, patchDictMaster);
703 addPatch(mesh, slaveName, groupNameSlave, patchDictSlave);
732 forAll(selectors, selectorI)
734 const word& name = selectors[selectorI].name();
738 const dictionary& dict = selectors[selectorI].dict();
743 if (dict.
found(
"patches"))
750 const word patchName(iter().
dict()[
"name"]);
754 newMasterPatches.
append(patchi);
758 newSlavePatches.
append(patchi);
765 const word masterName = selectors[selectorI].name() +
"_master";
768 const word slaveName = selectors[selectorI].name() +
"_slave";
789 <<
" faces into boundary faces in patches " 809 bool hasWarned =
false;
823 <<
"Setting field on boundary faces to zero." << endl
824 <<
"You might have to edit these fields." <<
endl;
838 forAll(selectors, selectorI)
840 const dictionary& dict = selectors[selectorI].dict();
841 if (dict.
found(
"patches"))
847 const word patchName(iter().
dict()[
"name"]);
858 fvMeshTools::setPatchFields
876 const word& groupName = selectors[selectorI].name();
878 if (patchSource.
found(
"patchFields"))
893 dict.
set(
"coupleGroup", groupName);
902 fvMeshTools::setPatchFields
912 const word masterPatchName(groupName +
"_master");
913 const word slavePatchName(groupName +
"_slave");
918 fvMeshTools::setPatchFields
925 fvMeshTools::setPatchFields
939 if (map().hasMotionPoints())
946 filterPatches(mesh, bafflePatches);
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
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.
label findZoneID(const word &zoneName) const
Find zone index given a name.
#define forAll(list, i)
Loop across all elements in list.
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.
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.
#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 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.
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.
Info<< "Calculating turbulent flame speed field St\"<< endl;volScalarField St(IOobject("St", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), flameWrinkling->Xi() *Su);multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields
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)
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...
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.
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.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
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.
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...
const meshFaceZones & faceZones() const
Return face zones.
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.
void clearAddressing()
Clear addressing.
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.