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])
220 mesh.
faces()[facei].reverseFace(),
240 if (!fZone.
flipMap()[zoneFacei])
246 mesh.
faces()[facei].reverseFace(),
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."
379 if (internalFacesOnly)
381 Info<<
"Not converting faces on non-coupled patches." <<
nl <<
endl;
393 forAll(selectors, selectorI)
395 const word&
name = selectors[selectorI].name();
416 forAll(selectors, selectorI)
418 const word&
name = selectors[selectorI].name();
421 selectors[selectorI].select(zoneID, faceToZoneID, faceToFlip);
426 forAll(faceToZoneID, facei)
428 label zoneID = faceToZoneID[facei];
434 forAll(selectors, selectorI)
436 const word&
name = selectors[selectorI].name();
439 label&
n = nFaces[zoneID];
444 forAll(faceToZoneID, facei)
446 label zone = faceToZoneID[facei];
450 flip[
n] = faceToFlip[facei];
455 Info<<
"Created zone '" <<
name <<
"' with "
492 forAll(selectors, selectorI)
494 const word& groupName = selectors[selectorI].name();
496 selectors[selectorI].dict().optionalSubDict(
"patches");
498 forAll(patchEntryKeywords, i)
503 patchEntryKeywords[i],
512 Info<<
"Adding patch '" << patchName <<
"' to the mesh" <<
endl;
515 patchDict.
set(
"nFaces", 0);
516 patchDict.
set(
"startFace", 0);
530 if (!groupName.empty() && !pp.
inGroup(groupName))
548 Info<<
"Patch '" << patchName
549 <<
"' already exists in the mesh" <<
endl;
552 patchDict.
remove(
"patchFields");
554 if (!patchDict.empty())
557 <<
"Patch settings found in " << patchDict.
name()
558 <<
" for patch '" << patchName <<
"', but this patch "
559 <<
"already exists so these settings will not be used"
564 bafflePatches.insert(patchName);
586 forAll(selectors, selectorI)
588 const word& groupName = selectors[selectorI].name();
594 selectors[selectorI].dict().optionalSubDict(
"patches");
597 forAll(patchEntryKeywords, i)
602 patchEntryKeywords[i],
612 const label nModified =
624 Info<<
"Converted " << nModified
625 <<
" faces into boundary faces on ";
626 if (newPatchIDs[0] == newPatchIDs[1])
633 <<
"' and '" <<
bMesh[newPatchIDs[1]].
name() <<
"'";
654 forAll(selectors, selectorI)
657 selectors[selectorI].dict().optionalSubDict(
"patches");
659 forAll(patchEntryKeywords, i)
664 patchEntryKeywords[i],
671 if (!bafflePatchFields.
found(patchName))
673 bafflePatchFields.
insert(patchName);
678 fvMeshTools::setPatchFields
687 if (patchDict.
found(
"patchFields"))
690 <<
"Patch field settings found in " << patchDict.
name()
691 <<
" for patch '" << patchName <<
"', but fields have "
692 <<
"already been set for this patch so these settings "
693 <<
"will not be used" <<
endl;
700 filterPatches(mesh, bafflePatches);
707 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 1D vector of objects of type <T> with a fixed size <Size>.
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.
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.
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.
bool optionFound(const word &opt) const
Return true if the named option is found.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
This boundary condition is not designed to be evaluated; it is assumed that the value is assigned via...
const fileName & name() const
Return the dictionary name.
A list of keyword definitions, which are a keyword followed by any number of values (e....
dictionary subOrEmptyDict(const word &, const bool mustRead=false) const
Find and return a sub-dictionary as a copy, or.
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T, if not found return the given default.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
void set(entry *)
Assign a new entry, overwrite any existing entry.
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.
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.
A subset of mesh faces organised as a primitive patch.
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.
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.
#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.
IOdictionary systemDict(const word &dictName, const argList &args, const objectRegistry &ob, const word ®ionName=polyMesh::defaultRegion)
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const bool)
Return a word representation of a bool.
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)
Ostream & indent(Ostream &os)
Indent stream.
Foam::argList args(argc, argv)