Go to the documentation of this file.
72 bool zoneFlip =
false;
115 if (!isA<processorPolyPatch>(pp))
128 || isA<coupledPolyPatch>(pp)
144 Info<<
"Removing zero-sized patch " << pp.
name()
145 <<
" type " << pp.type()
146 <<
" at position " << patchI <<
endl;
155 if (isA<processorPolyPatch>(pp))
172 Info<<
"Removing empty processor patch " << pp.
name()
173 <<
" at position " << patchI <<
endl;
179 if (nAllPatches != nOldPatches)
188 Info<<
"No patches removed." <<
endl;
191 delete allPatches[i];
206 isA<cyclicPolyPatch>(
patches[patchI])
207 && refCast<const cyclicPolyPatch>(
patches[patchI]).owner()
211 refCast<const cyclicPolyPatch>(
patches[patchI]);
216 Pout<<
"Dumping " << cycPatch.
name()
217 <<
" faces to " << str.name() <<
endl;
229 Pout<<
"Dumping " << nbrPatch.
name()
230 <<
" faces to " << str.name() <<
endl;
244 Pout<<
"Dumping cyclic match as lines between face centres to "
256 str<<
"l " << vertI-1 <<
' ' << vertI <<
nl;
269 if (separation.size() == 1)
275 field[i] += separation[0];
278 else if (separation.size() == field.
size())
282 field[i] += separation[i];
288 <<
"Sizes of field and transformation not equal. field:"
289 << field.
size() <<
" transformation:" << separation.size()
296 template<
class CombineOp>
301 const CombineOp& cop,
302 const point& nullValue
308 <<
"Number of values " <<
points.size()
309 <<
" is not equal to the number of points in the mesh "
316 bool hasTransformation =
false;
328 isA<processorPolyPatch>(pp)
330 && refCast<const processorPolyPatch>(pp).owner()
334 refCast<const processorPolyPatch>(pp);
344 label nbrPointI = nbrPts[pointI];
345 if (nbrPointI >= 0 && nbrPointI < patchInfo.size())
347 patchInfo[nbrPointI] =
points[meshPts[pointI]];
365 isA<processorPolyPatch>(pp)
367 && !refCast<const processorPolyPatch>(pp).owner()
371 refCast<const processorPolyPatch>(pp);
382 fromNbr >> nbrPatchInfo;
385 nbrPatchInfo.setSize(procPatch.
nPoints(), nullValue);
389 hasTransformation =
true;
394 hasTransformation =
true;
402 label meshPointI = meshPts[pointI];
403 points[meshPointI] = nbrPatchInfo[pointI];
416 isA<cyclicPolyPatch>(pp)
417 && refCast<const cyclicPolyPatch>(pp).owner()
421 refCast<const cyclicPolyPatch>(pp);
432 const edge&
e = coupledPoints[i];
433 label point0 = meshPts[
e[0]];
434 half0Values[i] =
points[point0];
439 hasTransformation =
true;
444 hasTransformation =
true;
450 const edge&
e = coupledPoints[i];
451 label point1 = nbrMeshPts[
e[1]];
452 points[point1] = half0Values[i];
466 if (hasTransformation)
469 <<
"There are decomposed cyclics in this mesh with"
470 <<
" transformations." <<
endl
471 <<
"This is not supported. The result will be incorrect"
502 int main(
int argc,
char *argv[])
510 "write obj files showing the cyclic matching process"
514 runTime.functionObjects().off();
540 patches.checkParallelSync(
true);
552 forAll(patchSources, addedI)
562 if (patchSources.size())
574 if (!isA<processorPolyPatch>(pp))
586 startFaceI += pp.size();
590 forAll(patchSources, addedI)
598 if (destPatchI == -1)
602 destPatchI = allPatches.size();
604 Info<<
"Adding new patch " << patchName
605 <<
" as patch " << destPatchI
606 <<
" from " << patchDict <<
endl;
608 patchDict.set(
"nFaces", 0);
609 patchDict.set(
"startFace", startFaceI);
625 Info<<
"Patch '" << patchName <<
"' already exists. Only "
626 <<
"moving patch faces - type will remain the same" <<
endl;
635 if (isA<processorPolyPatch>(pp))
647 startFaceI += pp.size();
666 forAll(patchSources, addedI)
673 if (destPatchI == -1)
676 <<
"patch " << patchName <<
" not added. Problem."
682 if (sourceType ==
"patches")
697 Info<<
"Moving faces from patch " << pp.
name()
698 <<
" to patch " << destPatchI <<
endl;
712 else if (sourceType ==
"set")
719 <<
" faces from faceSet " << faces.name() <<
endl;
733 <<
"Face " << faceI <<
" specified in set "
735 <<
" is not an external face of the mesh." <<
endl
736 <<
"This application can only repatch existing boundary"
752 <<
"Invalid source type " << sourceType <<
endl
761 Info<<
"Doing topology modification to order faces." <<
nl <<
endl;
773 Info<<
"Not synchronising points." <<
nl <<
endl;
790 if (pp.size() && isA<coupledPolyPatch>(pp))
793 refCast<const coupledPolyPatch>(pp);
797 Info<<
"On coupled patch " << pp.
name()
798 <<
" separation[0] was "
801 if (isA<cyclicPolyPatch>(pp) && pp.size())
804 refCast<const cyclicPolyPatch>(pp);
809 Info<<
"On cyclic translation patch " << pp.
name()
810 <<
" forcing uniform separation of "
827 Info<<
"On coupled patch " << pp.
name()
828 <<
" forcing uniform separation of "
833 Info<<
"On coupled patch " << pp.
name()
834 <<
" forcing uniform rotation of "
846 Info<<
"On coupled patch " << pp.
name()
847 <<
" forcing uniform rotation of "
853 Info<<
"Synchronising points." <<
endl;
862 point(GREAT, GREAT, GREAT)
875 Info<<
"Removing patches with no faces in them." <<
nl<<
endl;
898 Info<<
"Writing repatched mesh to " << runTime.timeName() <<
nl <<
endl;
vectorField pointField
pointField is a vectorField.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
virtual const pointField & points() const
Return raw points.
void syncPoints(const polyMesh &mesh, pointField &points, const CombineOp &cop, const point &nullValue)
void dumpCyclicMatch(const fileName &prefix, const polyMesh &mesh)
points setSize(newPointi)
virtual const vectorField & separation() const
If the planes are separated the separation vector.
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
const Field< PointType > & points() const
Return reference to global points.
A class for handling words, derived from string.
A class for handling file names.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
A PtrList of objects of type <T> with automated input and output.
static word defaultRegion
Return the default region name.
#define forAll(list, i)
Loop across all elements in list.
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.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Type gAverage(const FieldField< Field, Type > &f)
Output inter-processor communications stream.
const cyclicPolyPatch & neighbPatch() const
virtual const tensorField & forwardT() const
Return face transformation tensor.
int main(int argc, char *argv[])
static bool & parRun()
Is this a parallel run?
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
Direct mesh changes based on v1.3 polyTopoChange syntax.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
virtual const tensorField & reverseT() const
Return neighbour-cell transformation tensor.
static void addBoolOption(const word &opt, const string &usage="")
Add to a bool option to validOptions with usage information.
int neighbProcNo() const
Return neigbour processor number.
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.
The coupledPolyPatch is an abstract base class for patches that couple regions of the computational d...
dimensioned< scalar > mag(const dimensioned< Type > &)
void separateList(const vectorField &separation, UList< vector > &field)
const fileName & instance() const
labelList patchFaces(const polyBoundaryMesh &patches, const wordList &names)
A HashTable with keys but without contents.
Mesh consisting of general polyhedral cells.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
const faceZoneMesh & faceZones() const
Return face zone mesh.
const edgeList & coupledPoints() const
Return connected points (from patch local to neighbour patch local)
virtual bool parallel() const
Are the cyclic planes parallel.
virtual bool write() const
Write mesh using IO settings from time.
scalar diff(const triad &A, const triad &B)
Return a quantity of the difference between two triads.
const word dictName("particleTrackDict")
const fileName & pointsInstance() const
Return the current instance directory for points.
virtual bool separated() const
Are the planes separated.
label nGlobalPoints() const
Return number of globally shared points.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Pre-declare SubField and related Field type.
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.
virtual const fileName & name() const
Return the name of the stream.
virtual const labelList & faceOwner() const
Return face owner.
const word & name() const
Return name.
Neighbour processor patch.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
label whichZone(const label objectIndex) const
Given a global object index, return the zone it is in.
label nPoints() const
Return number of points supporting patch faces.
A list of keyword definitions, which are a keyword followed by any number of values (e....
label nInternalFaces() const
Various mesh related information for a parallel run. Upon construction, constructs all info using par...
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.
A list that is sorted upon construction or when explicitly requested with the sort() method.
bool found(const Key &) const
Return true if hashedEntry is found in table.
void writeObj(Ostream &os, const pointField &points)
label whichFace(const label globalCellID) const
Helper function to re-direct to zone::localID(...)
errorManip< error > abort(error &err)
const double e
Elementary charge.
label start() const
Return start label of this patch in the polyMesh face list.
virtual transformType transform() const
Type of transform.
virtual autoPtr< polyPatch > clone(const polyBoundaryMesh &bm) const
Construct and return a clone, resetting the boundary mesh.
errorManipArg< error, int > exit(error &err, const int errNo=1)
void removeBoundary()
Remove boundary patches.
void setInstance(const fileName &)
Set the instance for mesh files.
static void listCombineGather(const List< commsStruct > &comms, List< T > &Value, const CombineOp &cop, const int tag, const label comm)
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
virtual const faceList & faces() const
Return raw faces.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const labelList & neighbPoints() const
Return neighbour point labels. WIP.
label setAction(const topoAction &action)
For compatibility with polyTopoChange: set topological action.
static unsigned int defaultPrecision()
Return the default precision.
prefixOSstream Pout(cout, "Pout")
void addPatches(const List< polyPatch * > &, const bool validBoundary=true)
Add boundary patches.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
bool isInternalFace(const label faceIndex) const
Return true if given face label is internal to the mesh.
const vectorField & faceCentres() const
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
bool insert(const Key &key)
Insert a new entry.
bool optionFound(const word &opt) const
Return true if the named option is found.
const labelList & sharedPointLabels() const
Return indices of local points that are globally shared.
const labelList & sharedPointAddr() const
Return addressing into the complete globally shared points.
Input inter-processor communications stream.
void changePatchID(const polyMesh &mesh, const label faceID, const label patchID, polyTopoChange &meshMod)
void size(const label)
Override size to be inconsistent with allocated storage.
void transformList(const tensor &, UList< T > &)
Apply transformation to list. Either single transformation tensor.
const globalMeshData & globalData() const
Return parallel info.
static void listCombineScatter(const List< commsStruct > &comms, List< T > &Value, const int tag, const label comm)
Scatter data. Reverse of combineGather.
vector point
Point is a vector.
label size() const
Return the number of elements in the UList.
const labelList & meshPoints() const
Return labelList of mesh points in patch.
defineTemplateTypeNameAndDebug(IOPtrList< ensightPart >, 0)
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
Foam::argList args(argc, argv)
void filterPatches(polyMesh &mesh, const HashSet< word > &addedPatchNames)
const boolList & flipMap() const
Return face flip map.
bool optionReadIfPresent(const word &opt, T &) const
Read a value from the named option if present.
const word & name() const
Return name.
#define WarningInFunction
Report a warning using Foam::Warning.
const vector & separationVector() const
Translation vector for translational cyclics.
Type gMax(const FieldField< Field, Type > &f)
IOobject dictIO(dictName, runTime.constant(), mesh, IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE)