Go to the documentation of this file.
52 int main(
int argc,
char *argv[])
56 "Corrects the orientation of faceZone"
69 Info<<
"Orienting faceZone " << zoneName
70 <<
" such that " << outsidePoint <<
" is outside"
79 <<
"Face zone " << fZone.
name()
80 <<
" is not parallel synchronised."
81 <<
" Any coupled face also needs its coupled version to be included"
82 <<
" and with opposite flipMap."
109 label nProtected = 0;
113 const label meshFacei = faceLabels[facei];
114 const label patchi = bm.
whichPatch(meshFacei);
119 && bm[patchi].coupled()
120 && !isMasterFace[meshFacei]
129 Info<<
"Protected from visiting "
131 <<
" slaves of coupled faces" <<
nl <<
endl;
139 const label meshFacei = faceLabels[facei];
141 if (isMasterFace[meshFacei])
146 nMasterFaces[fEdges[fEdgeI]]++;
161 label nProtected = 0;
163 forAll(nMasterFaces, edgeI)
165 if (nMasterFaces[edgeI] > 2)
172 Info<<
"Protected from visiting "
174 <<
" non-manifold edges" <<
nl <<
endl;
196 forAll(allFaceInfo, facei)
200 unsetFacei = globalFaces.toGlobal(facei);
212 label proci = globalFaces.whichProcID(unsetFacei);
213 label seedFacei = globalFaces.toLocal(proci, unsetFacei);
214 Info<<
"Seeding from processor " << proci <<
" face " << seedFacei
221 vector d = outsidePoint-
patch.faceCentres()[seedFacei];
232 Pout<<
"Face " << seedFacei <<
" at "
233 <<
patch.faceCentres()[seedFacei]
234 <<
" with normal " << fn
235 <<
" needs to be flipped." <<
endl;
239 Pout<<
"Face " << seedFacei <<
" at "
240 <<
patch.faceCentres()[seedFacei]
241 <<
" with normal " << fn
242 <<
" points in positive direction (cos = " << (fn&d)/
mag(d)
250 label edgeI = fEdges[fEdgeI];
268 changedEdges.
append(edgeI);
269 changedInfo.
append(edgeInfo);
308 const label meshFacei = faceLabels[i];
312 allFaceInfo[i].flipStatus();
319 const label meshFacei = faceLabels[i];
320 const label patchi = bm.
whichPatch(meshFacei);
325 && bm[patchi].coupled()
326 && !isMasterFace[meshFacei]
343 <<
"Incorrect status for face " << meshFacei
353 boolList newFlipMap(allFaceInfo.size(),
false);
355 forAll(allFaceInfo, facei)
359 newFlipMap[facei] =
false;
363 newFlipMap[facei] =
true;
368 <<
"Problem : unvisited face " << facei
373 if (fZone.
flipMap()[facei] != newFlipMap[facei])
382 Info<<
"Flipping " << nChanged <<
" out of "
383 << globalFaces.size() <<
" faces." <<
nl <<
endl;
385 mesh.
faceZones()[zoneName].resetAddressing(faceLabels, newFlipMap);
virtual const pointField & points() const
Return raw points.
Transport of orientation for use in PatchEdgeFaceWave.
A class for handling words, derived from Foam::string.
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.
static constexpr const zero Zero
Global zero (0)
label nInternalFaces() const
Number of internal faces.
Wave propagation of information along patch. Every iteration information goes through one layer of fa...
void flip()
Reverse the orientation.
static void addNote(const string ¬e)
Add extra notes for the usage information.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const edgeList & edges() const
Return mesh edges. Uses calcEdges.
prefixOSstream Pout
An Ostream wrapper for parallel output to std::cout.
const labelListList & pointEdges() const
T get(const label index) const
Get a value from the argument at index.
#define forAll(list, i)
Loop across all elements in list.
const faceZoneMesh & faceZones() const
Return face zone mesh.
static void addArgument(const string &argName, const string &usage="")
Append a (mandatory) argument to validArgs.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
bool updateEdge(const polyMesh &mesh, const indirectPrimitivePatch &patch, const label edgeI, const label facei, const patchFaceOrientation &faceInfo, const scalar tol, TrackingData &td)
Influence of face on edge.
A subset of mesh faces organised as a primitive patch.
messageStream Info
Information stream (uses stdout - output is on the master only)
DynamicList< T, SizeMin > & append(const T &val)
Append an element to the end of this list.
A List with indirect addressing.
label whichPatch(const label faceIndex) const
Return patch index for a given face label.
label nBoundaryFaces() const
Number of boundary faces (== nFaces - nInternalFaces)
errorManip< error > abort(error &err)
const word & name() const
Return name.
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
errorManipArg< error, int > exit(error &err, const int errNo=1)
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
PrimitivePatch< IndirectList< face >, const pointField & > indirectPrimitivePatch
A PrimitivePatch with an IndirectList for the faces, const reference for the point field.
virtual bool checkParallelSync(const bool report=false) const
Check whether all procs have faces synchronised.
virtual const faceList & faces() const
Return raw faces.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const std::string patch
OpenFOAM patch number as a std::string.
bool isInternalFace(const label faceIndex) const
Return true if given face label is internal to the mesh.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
const vectorField & faceCentres() const
Foam::argList args(argc, argv)
const boolList & flipMap() const
Return face flip map.
A list of faces which address into the list of points.