79 if (!isA<processorPolyPatch>(pp))
88 oldToNew[
patchi] = newPatchi++;
98 if (isA<processorPolyPatch>(pp))
100 oldToNew[
patchi] = newPatchi++;
105 const label nKeepPatches = newPatchi;
115 if (oldToNew[
patchi] == -1)
121 oldToNew[
patchi] = newPatchi++;
141 const bool flipFaceFlux,
142 const label newPatchi,
148 if (!modifiedFace[facei])
167 modifiedFace[facei] = 1;
194 const bool internalFacesOnly,
197 const label newOwnerPatchi,
198 const label newNeighbourPatchi,
214 if (!fZone.
flipMap()[zoneFacei])
239 mesh.
faces()[facei].reverseFace(),
261 if (!fZone.
flipMap()[zoneFacei])
267 mesh.
faces()[facei].reverseFace(),
301 if (pp.
coupled() || !internalFacesOnly)
312 ?
bMesh[newNeighbourPatchi]
313 :
bMesh[newOwnerPatchi];
320 <<
"Face on coupled patch \"" << pp.
name()
321 <<
"\" selected for conversion to coupled "
322 <<
"patch \"" << newPp.
name() <<
"\". "
323 <<
"Conversion from coupled patch to coupled "
324 <<
"patch is not allowed."
351 int main(
int argc,
char *argv[])
355 "Makes internal faces into boundary faces.\n"
356 "Does not duplicate points."
407 if (internalFacesOnly)
409 Info<<
"Not converting faces on non-coupled patches." <<
nl <<
endl;
421 forAll(selectors, selectorI)
423 const word&
name = selectors[selectorI].name();
446 forAll(selectors, selectorI)
448 const word&
name = selectors[selectorI].name();
451 selectors[selectorI].select(zoneID, faceToZoneID, faceToFlip);
456 forAll(faceToZoneID, facei)
458 label zoneID = faceToZoneID[facei];
464 forAll(selectors, selectorI)
466 const word&
name = selectors[selectorI].name();
469 label&
n = nFaces[zoneID];
474 forAll(faceToZoneID, facei)
480 flip[
n] = faceToFlip[facei];
485 Info<<
"Created zone '" <<
name <<
"' with "
522 forAll(selectors, selectorI)
524 const word& groupName = selectors[selectorI].name();
526 selectors[selectorI].dict().optionalSubDict(
"patches");
528 forAll(patchEntryKeywords, i)
533 patchEntryKeywords[i],
542 Info<<
"Adding patch '" << patchName <<
"' to the mesh" <<
endl;
545 patchDict.
set(
"nFaces", 0);
546 patchDict.
set(
"startFace", 0);
560 if (!groupName.empty() && !pp.
inGroup(groupName))
578 Info<<
"Patch '" << patchName
579 <<
"' already exists in the mesh" <<
endl;
582 patchDict.
remove(
"patchFields");
584 if (!patchDict.empty())
587 <<
"Patch settings found in " << patchDict.
name()
588 <<
" for patch '" << patchName <<
"', but this patch "
589 <<
"already exists so these settings will not be used"
594 bafflePatches.insert(patchName);
616 forAll(selectors, selectorI)
618 const word& groupName = selectors[selectorI].name();
623 selectors[selectorI].dict().optionalSubDict(
"patches");
626 forAll(patchEntryKeywords, i)
631 patchEntryKeywords[i],
641 const label nModified =
653 Info<<
"Converted " << nModified
654 <<
" faces into boundary faces on ";
655 if (newPatchIDs[0] == newPatchIDs[1])
662 <<
"' and '" <<
bMesh[newPatchIDs[1]].
name() <<
"'";
683 forAll(selectors, selectorI)
686 selectors[selectorI].dict().optionalSubDict(
"patches");
688 forAll(patchEntryKeywords, i)
693 patchEntryKeywords[i],
700 if (!bafflePatchFields.
found(patchName))
702 bafflePatchFields.
insert(patchName);
707 fvMeshTools::setPatchFields
716 if (patchDict.
found(
"patchFields"))
719 <<
"Patch field settings found in " << patchDict.
name()
720 <<
" for patch '" << patchName <<
"', but fields have "
721 <<
"already been set for this patch so these settings "
722 <<
"will not be used" <<
endl;
729 if (map().hasMotionPoints())
735 filterPatches(mesh, bafflePatches);
742 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.
label findZoneID(const word &zoneName) const
Find zone index given a name.
void clearAddressing()
Clear addressing.
bool checkParallelSync(const bool report=false) const
Check whether all procs have all zones and in same order. Return.
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 UPtrList.
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,.
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.
label whichFace(const label globalCellID) const
Helper function to re-direct to zone::localID(...)
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.
virtual void setPoints(const pointField &)
Reset the points.
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.
A face addition data class. A face can be inflated either from a point or from another face and can e...
label findPatchID(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.
const meshFaceZones & faceZones() const
Return face zones.
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 polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
virtual const labelList & faceNeighbour() const
Return face neighbour.
void setInstance(const fileName &)
Set the instance for mesh files.
Class describing modification of a face.
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 inflate, const bool syncParallel=true, const bool orderCells=false, const bool orderPoints=false)
Inplace changes mesh without change of patches.
label setAction(const topoAction &action)
For compatibility with polyTopoChange: set topological action.
label nInternalFaces() const
A class for handling words, derived from string.
label index() const
Return the index of this zone in zone list.
#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)