Go to the documentation of this file.
69 const word& patchName,
70 const word& groupName,
90 if (!groupName.empty())
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)
141 || addedPatchNames.found(pp.
name())
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 "
836 << bafflePatches.sortedToc() <<
nl <<
endl;
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)
A class for handling words, derived from Foam::string.
const boolList & flipMap() const noexcept
virtual bool write(const bool valid=true) const
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)
static constexpr const zero Zero
bool found(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
const word dictName("faMeshDefinition")
virtual bool coupled() const
const HashTable< labelList > & groupPatchIDs() const
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)
void set(const bitSet &bitset)
Class describing modification of a face.
virtual tmp< scalarField > movePoints(const pointField &)
const polyBoundaryMesh & boundaryMesh() const
Ostream & endl(Ostream &os)
const T * set(const label i) const
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
entry * set(entry *entryPtr)
virtual label sizeBeforeMapping() const
A HashTable with keys but without contents that is similar to std::unordered_set.
Ostream & incrIndent(Ostream &os)
const fileName & pointsInstance() const
bool checkParallelSync(const bool report=false) const
static void noFunctionObjects(bool addWithOption=false)
const wordList & inGroups() const noexcept
A subset of mesh faces organised as a primitive patch.
A patch is a list of labels that address the faces in the global face list.
DynamicList< T, SizeMin > & append(const T &val)
virtual const labelList & faceOwner() const
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
virtual void updateMesh(const mapPolyMesh &mpm)
const faceZoneMesh & faceZones() const noexcept
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
label appendUniq(const T &val)
autoPtr< mapPolyMesh > changeMesh(polyMesh &mesh, const labelUList &patchMap, const bool inflate, const bool syncParallel=true, const bool orderCells=false, const bool orderPoints=false)
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)
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)
label whichFace(const label globalCellID) const
label findZoneID(const word &zoneName) const
Ostream & indent(Ostream &os)
List of IOobjects with searching and retrieving facilities.
void resize(const label newLen)
label index() const noexcept
const word & name() const noexcept
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
virtual const faceList & faces() const
label setAction(const topoAction &action)
Field reading functions for post-processing utilities.
const word & name() const noexcept
Class holds all the necessary information for mapping fields associated with fvMesh.
label nInternalFaces() const noexcept
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
static void removeFiles(const polyMesh &mesh)
bool insert(const Key &key)
word name(const expressions::valueTypeCode typeCode)
A face addition data class. A face can be inflated either from a point or from another face and can e...
label nFaces() const noexcept
A face is a list of labels corresponding to mesh vertices.
const word & name() const noexcept
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)
Foam::argList args(argc, argv)
static void removeFiles(const polyMesh &)
bool checkParallelSync(const bool report=false) const
#define WarningInFunction
void setInstance(const fileName &instance, const IOobject::writeOption wOpt=IOobject::AUTO_WRITE)
virtual const labelList & faceNeighbour() const
bool found(const word &optName) const