Go to the documentation of this file.
69 const word& patchName,
70 const word& groupName,
90 if (!groupName.empty() && !pp.
inGroup(groupName))
108 Info<<
"Patch '" << patchName
109 <<
"' already exists. Only "
110 <<
"moving patch faces - type will remain the same"
135 if (!isA<processorPolyPatch>(pp))
139 isA<coupledPolyPatch>(pp)
145 oldToNew[patchi] = newPatchi++;
154 if (isA<processorPolyPatch>(pp))
156 oldToNew[patchi] = newPatchi++;
161 const label nKeepPatches = newPatchi;
164 if (nKeepPatches != pbm.size())
171 if (oldToNew[patchi] == -1)
174 <<
" type " << pbm[patchi].type()
175 <<
" at position " << patchi <<
endl;
176 oldToNew[patchi] = newPatchi++;
193 const bool flipFaceFlux,
194 const label newPatchi,
201 if (modifiedFace.
set(facei))
247 const bool internalFacesOnly,
259 forAll(newMasterPatches, i)
266 label zoneFacei = fZone.
whichFace(facei);
270 if (!fZone.
flipMap()[zoneFacei])
316 label zoneFacei = fZone.
whichFace(facei);
320 if (!fZone.
flipMap()[zoneFacei])
374 const label newMasterPatchi = newMasterPatches[i];
375 const label newSlavePatchi = newSlavePatches[i];
381 pbm[newMasterPatchi].coupled()
382 || pbm[newSlavePatchi].coupled()
389 else if (pp.
coupled() || !internalFacesOnly)
393 label facei = pp.
start()+i;
395 label zoneFacei = fZone.
whichFace(facei);
399 if (patchWarned.
insert(patchi))
402 <<
"Found boundary face (in patch "
404 <<
") in faceZone " << fZone.
name()
405 <<
" to convert to baffle patches "
406 << pbm[newMasterPatchi].
name() <<
"/"
407 << pbm[newSlavePatchi].
name()
409 <<
" Set internalFacesOnly to true in the"
410 <<
" createBaffles control dictionary if you"
411 <<
" don't wish to convert boundary faces."
439 int main(
int argc,
char *argv[])
443 "Makes internal faces into boundary faces.\n"
444 "Does not duplicate points."
458 const bool overwrite =
args.
found(
"overwrite");
465 bool internalFacesOnly(
false);
467 bool noFields(
false);
474 internalFacesOnly =
dict.
get<
bool>(
"internalFacesOnly");
479 selectors.
resize(selectionsDict.size());
482 for (
const entry& dEntry : selectionsDict)
496 selectors.
resize(nselect);
500 if (internalFacesOnly)
502 Info<<
"Not converting faces on non-coupled patches." <<
nl <<
endl;
510 Info<<
"Reading geometric fields" <<
nl <<
endl;
549 forAll(selectors, selectorI)
551 const word&
name = selectors[selectorI].name();
574 forAll(selectors, selectorI)
576 const word&
name = selectors[selectorI].name();
579 selectors[selectorI].select(
zoneID, faceToZoneID, faceToFlip);
584 forAll(faceToZoneID, facei)
586 label
zoneID = faceToZoneID[facei];
593 forAll(selectors, selectorI)
595 const word&
name = selectors[selectorI].name();
602 forAll(faceToZoneID, facei)
604 label
zone = faceToZoneID[facei];
608 flip[
n] = faceToFlip[facei];
637 forAll(selectors, selectorI)
645 const word patchName(dEntry.dict().get<
word>(
"name"));
647 bafflePatches.
insert(patchName);
652 const word masterName = selectors[selectorI].name() +
"_master";
653 bafflePatches.
insert(masterName);
655 const word slaveName = selectors[selectorI].name() +
"_slave";
656 bafflePatches.
insert(slaveName);
681 forAll(selectors, selectorI)
684 const word& groupName = selectors[selectorI].name();
697 patchDict.
set(
"nFaces", 0);
698 patchDict.
set(
"startFace", 0);
705 addPatch(
mesh, patchName, groupName, patchDict);
709 Info<<
"Patch '" << patchName
710 <<
"' already exists. Only "
711 <<
"moving patch faces - type will remain the same"
719 const word masterName = groupName +
"_master";
720 const word slaveName = groupName +
"_slave";
722 word groupNameMaster = groupName;
723 word groupNameSlave = groupName;
727 patchDictMaster.set(
"nFaces", 0);
728 patchDictMaster.set(
"startFace", 0);
729 patchDictMaster.set(
"coupleGroup", groupName);
737 const bool sameGroup =
742 groupNameMaster = groupName +
"Group_master";
743 groupNameSlave = groupName +
"Group_slave";
744 patchDictMaster.set(
"coupleGroup", groupNameMaster);
745 patchDictSlave.set(
"coupleGroup", groupNameSlave);
748 addPatch(
mesh, masterName, groupNameMaster, patchDictMaster);
749 addPatch(
mesh, slaveName, groupNameSlave, patchDictSlave);
778 forAll(selectors, selectorI)
780 const word&
name = selectors[selectorI].name();
795 const word patchName(dEntry.dict().get<
word>(
"name"));
801 newMasterPatches.
append(patchi);
805 newSlavePatches.
append(patchi);
812 const word masterName = selectors[selectorI].name() +
"_master";
815 const word slaveName = selectors[selectorI].name() +
"_slave";
835 <<
" faces into boundary faces in patches "
854 bool hasWarned =
false;
856 for (
const word& patchName : bafflePatches)
868 <<
"Setting field on boundary faces to zero." <<
endl
869 <<
"You might have to edit these fields." <<
endl;
883 forAll(selectors, selectorI)
896 if (dEntry.dict().found(
"patchFields"))
904 fvMeshTools::setPatchFields
917 const bool sameGroup =
920 const word& groupName = selectors[selectorI].name();
922 if (patchSource.
found(
"patchFields"))
932 for (
entry& dEntry : patchFieldsDict)
937 dict.
set(
"coupleGroup", groupName);
946 fvMeshTools::setPatchFields
956 const word masterPatchName(groupName +
"_master");
957 const word slavePatchName(groupName +
"_slave");
959 label patchiMaster = pbm.
findPatchID(masterPatchName);
960 label patchiSlave = pbm.
findPatchID(slavePatchName);
962 fvMeshTools::setPatchFields
969 fvMeshTools::setPatchFields
983 if (map().hasMotionPoints())
990 filterPatches(
mesh, bafflePatches);
A keyword and a list of tokens is an 'entry'.
Mapping class for a fvPatchField.
List< label > labelList
A List of labels.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
static autoPtr< faceSelection > New(const word &name, const fvMesh &mesh, const dictionary &dict)
Return a reference to the selected faceSelection.
const word & name() const
Return name.
A class for handling words, derived from Foam::string.
virtual bool write(const bool valid=true) const
Write mesh using IO settings from time.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO.
wordList ReadFields(const typename GeoMesh::Mesh &mesh, const IOobjectList &objects, PtrList< GeometricField< Type, PatchField, GeoMesh >> &fields, const bool syncPar=true, const bool readOldTime=false)
Read Geometric fields of templated type.
static constexpr const zero Zero
Global zero (0)
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.
bool found(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Search for an entry (const access) with the given keyword.
label nInternalFaces() const
Number of internal faces.
label nFaces() const
Number of mesh faces.
virtual bool coupled() const
Return true if this patch is geometrically coupled (i.e. faces and.
const HashTable< labelList > & groupPatchIDs() const
The patch indices per patch group.
static word timeName(const scalar t, const int precision=precision_)
Direct mesh changes based on v1.3 polyTopoChange syntax.
Base class for mesh zones.
static void addNote(const string ¬e)
Add extra notes for the usage information.
const word dictName("blockMeshDict")
void set(const bitSet &bitset)
Set specified bits from another bitset.
void append(const T &val)
Append an element at the end of the list.
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.
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
entry * set(entry *entryPtr)
Assign a new entry, overwriting any existing entry.
virtual label sizeBeforeMapping() const
Return size of field before mapping.
Ostream & incrIndent(Ostream &os)
Increment the indent level.
#define forAll(list, i)
Loop across all elements in list.
const faceZoneMesh & faceZones() const
Return face zone mesh.
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.
static void noFunctionObjects(bool addWithOption=false)
Remove '-noFunctionObjects' option and ignore any occurrences.
const wordList & inGroups() const
The (optional) groups that the patch belongs to.
A subset of mesh faces organised as a primitive patch.
bool inGroup(const word &name) const
True if the patch is in named group.
messageStream Info
Information stream (uses stdout - output is on the master only)
A patch is a list of labels that address the faces in the global face list.
word name(const complex &c)
Return string representation of complex.
DynamicList< T, SizeMin > & append(const T &val)
Append an element to the end of this list.
virtual const labelList & faceOwner() const
Return face owner.
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
virtual void updateMesh(const mapPolyMesh &mpm)
Update mesh corresponding to the given map.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
label findPatchID(const word &patchName, const bool allowNotFound=true) const
Find patch index given a name, return -1 if not found.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
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.
const labelIOList & zoneID
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...
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
label whichFace(const label globalCellID) const
Helper function to re-direct to zone::localID(...)
const T * set(const label i) const
Return const pointer to element (if set) or nullptr.
const word & name() const
Return name.
label findZoneID(const word &zoneName) const
Find zone index given a name, return -1 if not found.
Ostream & indent(Ostream &os)
Indent stream.
List< Key > sortedToc() const
The table of contents (the keys) in sorted order.
label start() const
Return start label of this patch in the polyMesh face list.
List of IOobjects with searching and retrieving facilities.
void resize(const label newLen)
Adjust size of PtrList.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
virtual const faceList & faces() const
Return raw faces.
label setAction(const topoAction &action)
For compatibility with polyTopoChange: set topological action.
Field reading functions for post-processing utilities.
Class holds all the necessary information for mapping fields associated with fvMesh.
static void removeFiles(const polyMesh &mesh)
Helper: remove all procAddressing files from mesh instance.
bool insert(const Key &key)
Insert a new entry, not overwriting existing entries.
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.
bool found(const Key &key) const
Return true if hashed entry is found in table.
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
static void addOption(const word &optName, const string ¶m="", const string &usage="", bool advanced=false)
Add an option to validOptions with usage information.
Foam::argList args(argc, argv)
const boolList & flipMap() const
Return face flip map.
static void removeFiles(const polyMesh &)
Helper: remove all sets files from mesh instance.
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.
const word & name() const
The patch name.
#define WarningInFunction
Report a warning using Foam::Warning.
void setInstance(const fileName &instance, const IOobject::writeOption wOpt=IOobject::AUTO_WRITE)
Set the instance for mesh files.
virtual const labelList & faceNeighbour() const
Return face neighbour.
bool found(const word &optName) const
Return true if the named option is found.