77 if (!isA<processorPolyPatch>(pp))
86 oldToNew[
patchi] = newPatchi++;
96 if (isA<processorPolyPatch>(pp))
98 oldToNew[
patchi] = newPatchi++;
103 const label nKeepPatches = newPatchi;
113 if (oldToNew[
patchi] == -1)
119 oldToNew[
patchi] = newPatchi++;
139 const bool flipFaceFlux,
140 const label newPatchi,
144 if (!modifiedFace[facei])
157 modifiedFace[facei] = 1;
177 const bool internalFacesOnly,
180 const label newOwnerPatchi,
181 const label newNeighbourPatchi,
197 if (!fZone.
flipMap()[zoneFacei])
240 if (!fZone.
flipMap()[zoneFacei])
276 if (pp.
coupled() || !internalFacesOnly)
287 ?
bMesh[newNeighbourPatchi]
288 :
bMesh[newOwnerPatchi];
295 <<
"Face on coupled patch \"" << pp.
name()
296 <<
"\" selected for conversion to coupled "
297 <<
"patch \"" << newPp.
name() <<
"\". "
298 <<
"Conversion from coupled patch to coupled "
299 <<
"patch is not allowed."
324 int main(
int argc,
char *argv[])
328 "Makes internal faces into boundary faces.\n"
329 "Does not duplicate points."
380 if (internalFacesOnly)
382 Info<<
"Not converting faces on non-coupled patches." <<
nl <<
endl;
394 forAll(selectors, selectorI)
396 const word&
name = selectors[selectorI].name();
417 forAll(selectors, selectorI)
419 const word&
name = selectors[selectorI].name();
422 selectors[selectorI].select(zoneID, faceToZoneID, faceToFlip);
427 forAll(faceToZoneID, facei)
429 label zoneID = faceToZoneID[facei];
435 forAll(selectors, selectorI)
437 const word&
name = selectors[selectorI].name();
440 label&
n = nFaces[zoneID];
445 forAll(faceToZoneID, facei)
447 label zone = faceToZoneID[facei];
451 flip[
n] = faceToFlip[facei];
456 Info<<
"Created zone '" <<
name <<
"' with "
493 forAll(selectors, selectorI)
495 const word& groupName = selectors[selectorI].name();
497 selectors[selectorI].dict().optionalSubDict(
"patches");
499 forAll(patchEntryKeywords, i)
504 patchEntryKeywords[i],
513 Info<<
"Adding patch '" << patchName <<
"' to the mesh" <<
endl;
516 patchDict.set(
"nFaces", 0);
517 patchDict.set(
"startFace", 0);
534 <<
"Patches of type '" << pp.type() <<
"' cannot be "
535 <<
"created in parallel. They must be created in "
540 isA<processorPolyPatch>(pp)
541 || isA<nonConformalPolyPatch>(pp)
545 <<
"Patches of type '" << pp.type() <<
"' cannot be "
550 if (!groupName.empty() && !pp.
inGroup(groupName))
561 Info<<
"Patch '" << patchName
562 <<
"' already exists in the mesh" <<
endl;
565 patchDict.
remove(
"patchFields");
567 if (!patchDict.empty())
570 <<
"Patch settings found in " << patchDict.
name()
571 <<
" for patch '" << patchName <<
"', but this patch "
572 <<
"already exists so these settings will not be used"
577 bafflePatches.insert(patchName);
602 forAll(selectors, selectorI)
604 const word& groupName = selectors[selectorI].name();
610 selectors[selectorI].dict().optionalSubDict(
"patches");
613 forAll(patchEntryKeywords, i)
618 patchEntryKeywords[i],
628 const label nModified =
640 Info<<
"Converted " << nModified
641 <<
" faces into boundary faces on ";
642 if (newPatchIDs[0] == newPatchIDs[1])
649 <<
"' and '" <<
bMesh[newPatchIDs[1]].
name() <<
"'";
670 forAll(selectors, selectorI)
673 selectors[selectorI].dict().optionalSubDict(
"patches");
675 forAll(patchEntryKeywords, i)
680 patchEntryKeywords[i],
687 if (!bafflePatchFields.
found(patchName))
689 bafflePatchFields.
insert(patchName);
694 fvMeshTools::setPatchFields
703 if (patchDict.
found(
"patchFields"))
706 <<
"Patch field settings found in " << patchDict.
name()
707 <<
" for patch '" << patchName <<
"', but fields have "
708 <<
"already been set for this patch so these settings "
709 <<
"will not be used" <<
endl;
716 filterPatches(
mesh, bafflePatches);
723 Info<<
"Writing mesh to " << runTime.name() <<
endl;
Field reading functions for post-processing utilities.
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
A HashTable with keys but without contents.
bool insert(const Key &key)
Insert a new entry.
bool found(const Key &) const
Return true if hashedEntry is found in table.
List of IOobjects with searching and retrieving facilities.
const word & name() const
Return name.
void append(const T &)
Append an element at the end of the list.
An ordered pair of two objects of type <Type> with first() and second() elements.
autoPtr< T > set(const label, const word &key, T *)
Set element to pointer provided and return old element.
label findIndex(const word &key) const
Return the index of the given the key or -1 if not found.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
bool set(const label) const
Is element set.
void setSize(const label)
Reset size of PtrList. If extending the PtrList, new entries are.
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
label size() const
Return the number of elements in the UList.
static bool & parRun()
Is this a parallel run?
label size() const
Return the number of elements in the UPtrList.
bool checkParallelSync(const bool report=false) const
Check whether all procs have all zones and in same order. Return.
label localIndex(const label globalIndex) const
Map storing the local index for every global index. Used to find.
static void addNote(const string &)
Add extra notes for the usage information.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
const fileName & name() const
Return the dictionary name.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
const dictionary & subOrEmptyDict(const word &, const bool mustRead=false) const
Find and return a sub-dictionary.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
bool remove(const word &)
Remove an entry specified by keyword.
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
const entry & lookupEntryBackwardsCompatible(const wordList &, bool recursive, bool patternMatch) const
Find and return an entry data stream if present, trying a list.
T lookupOrDefault(const word &, const T &, const bool writeDefault=writeOptionalEntries > 0) const
Find and return a T, if not found return the given default.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
virtual const dictionary & dict() const =0
Return dictionary if this entry is a dictionary.
static autoPtr< faceSelection > New(const word &name, const fvMesh &mesh, const dictionary &dict)
Return a reference to the selected faceSelection.
Named list of face indices representing a sub-set of the mesh faces.
const boolList & flipMap() const
Return face flip map.
A face is a list of labels corresponding to mesh vertices.
Mesh data needed to do the Finite Volume discretisation.
virtual bool write(const bool write=true) const
Write mesh using IO settings from time.
const word & name() const
Return reference to name.
virtual void topoChange(const polyTopoChangeMap &map)
Update mesh corresponding to the given map.
static bool constraintType(const word &pt)
Return true if the given type is a constraint type.
label index() const
Return the index of this patch in the boundaryMesh.
bool inGroup(const word &) const
Test if in group.
const wordList & inGroups() const
Return the optional groups patch belongs to.
const word & name() const
Return name.
label findIndex(const word &patchName) const
Find patch index given a name.
bool checkParallelSync(const bool report=false) const
Check whether all procs have all patches and in same order. Return.
virtual const faceList & faces() const
Return raw faces.
virtual const labelList & faceOwner() const
Return face owner.
const fileName & pointsInstance() const
Return the current instance directory for points.
const faceZoneList & faceZones() const
Return face zones.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
virtual const labelList & faceNeighbour() const
Return face neighbour.
void setInstance(const fileName &)
Set the instance for mesh files.
A patch is a list of labels that address the faces in the global face list.
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.
virtual bool coupled() const
Return true if this patch is geometrically coupled (i.e. faces and.
label start() const
Return start label of this patch in the polyMesh face list.
Direct mesh changes based on v1.3 polyTopoChange syntax.
autoPtr< polyTopoChangeMap > changeMesh(polyMesh &mesh, const bool syncParallel=true, const bool orderCells=false, const bool orderPoints=false)
Inplace changes mesh without change of patches.
void modifyFace(const face &f, const label facei, const label own, const label nei, const bool flipFaceFlux, const label patchID)
Modify vertices or cell of face.
label addFace(const face &f, const label own, const label nei, const label masterFaceID, const bool flipFaceFlux, const label patchID)
Add face to cells and return new face index.
label nInternalFaces() const
A class for handling words, derived from string.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
int main(int argc, char *argv[])
const polyBoundaryMesh & bMesh
Info<< "Calculating turbulent flame speed field St\n"<< endl;volScalarField St(IOobject("St", runTime.name(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), flameWrinkling->Xi() *Su);multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields
#define WarningInFunction
Report a warning using Foam::Warning.
errorManipArg< error, int > exit(error &err, const int errNo=1)
List< word > wordList
A List of words.
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
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 & endl(Ostream &os)
Add newline and flush stream.
Ostream & incrIndent(Ostream &os)
Increment the indent level.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
IOdictionary systemDict(const word &dictName, const argList &args, const objectRegistry &ob, const word ®ionName=polyMesh::defaultRegion, const fileName &path=fileName::null)
Ostream & indent(Ostream &os)
Indent stream.
Foam::argList args(argc, argv)