53 int main(
int argc,
char *argv[])
57 "Corrects the orientation of faceZone" 70 Info<<
"Orienting faceZone " << zoneName
71 <<
" such that " << outsidePoint <<
" is outside" 80 <<
"Face zone " << fZone.
name()
81 <<
" is not parallel synchronised." 82 <<
" Any coupled face also needs its coupled version to be included" 83 <<
" and with opposite flipMap." 110 label nProtected = 0;
115 const label patchi = bm.
whichPatch(meshFacei);
121 && !isMasterFace[meshFacei]
130 Info<<
"Protected from visiting " 132 <<
" slaves of coupled faces" <<
nl <<
endl;
142 if (isMasterFace[meshFacei])
147 nMasterFaces[fEdges[fEdgeI]]++;
162 label nProtected = 0;
164 forAll(nMasterFaces, edgeI)
166 if (nMasterFaces[edgeI] > 2)
173 Info<<
"Protected from visiting " 175 <<
" non-manifold edges" <<
nl <<
endl;
197 forAll(allFaceInfo, facei)
201 unsetFacei = globalFaces.toGlobal(facei);
213 label proci = globalFaces.whichProcID(unsetFacei);
214 label seedFacei = globalFaces.toLocal(proci, unsetFacei);
215 Info<<
"Seeding from processor " << proci
216 <<
" face " << seedFacei <<
endl;
222 vector d = outsidePoint-
patch.faceCentres()[seedFacei];
233 Pout<<
"Face " << seedFacei <<
" at " 234 <<
patch.faceCentres()[seedFacei]
235 <<
" with normal " << fn
236 <<
" needs to be flipped." <<
endl;
240 Pout<<
"Face " << seedFacei <<
" at " 241 <<
patch.faceCentres()[seedFacei]
242 <<
" with normal " << fn
243 <<
" points in positive direction (cos = " << (fn&d)/
mag(d)
251 label edgeI = fEdges[fEdgeI];
269 changedEdges.
append(edgeI);
270 changedInfo.
append(edgeInfo);
313 allFaceInfo[i].flipStatus();
321 const label patchi = bm.
whichPatch(meshFacei);
327 && !isMasterFace[meshFacei]
344 <<
"Incorrect status for face " << meshFacei
354 boolList newFlipMap(allFaceInfo.size(),
false);
356 forAll(allFaceInfo, facei)
360 newFlipMap[facei] =
false;
364 newFlipMap[facei] =
true;
369 <<
"Problem : unvisited face " << facei
374 if (fZone.
flipMap()[facei] != newFlipMap[facei])
383 Info<<
"Flipping " << nChanged <<
" out of " 384 << globalFaces.totalSize() <<
" faces." <<
nl <<
endl;
static void addNote(const string ¬e)
Add extra notes for the usage information.
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.
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const labelListList & pointEdges() const
Wave propagation of information along patch. Every iteration information goes through one layer of fa...
constexpr char nl
The newline '\n' character (0x0a)
bool empty() const noexcept
True if List is empty (ie, size() is zero)
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual bool checkParallelSync(const bool report=false) const
Check whether all procs have faces synchronised.
Transport of orientation for use in PatchEdgeFaceWave.
static int myProcNo(const label communicator=worldComm)
Rank of this process in the communicator (starting from masterNo()). Can be negative if the process i...
PrimitivePatch< IndirectList< face >, const pointField & > indirectPrimitivePatch
A PrimitivePatch with an IndirectList for the faces, const reference for the point field...
labelList faceLabels(nFaceLabels)
T returnReduce(const T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Perform reduction on a copy, using specified binary operation.
bool isInternalFace(const label faceIndex) const noexcept
Return true if given face label is internal to the mesh.
virtual const pointField & points() const
Return raw points.
#define forAll(list, i)
Loop across all elements in list.
A list of faces which address into the list of points.
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
bool returnReduceAnd(const bool value, const label comm=UPstream::worldComm)
Perform logical (and) MPI Allreduce on a copy. Uses UPstream::reduceAnd.
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
A class for handling words, derived from Foam::string.
virtual bool write(const bool writeOnProc=true) const
Write using setting from DB.
void flip()
Reverse the orientation.
label nInternalFaces() const noexcept
Number of internal faces.
void append(const T &val)
Copy append an element to the end of this list.
virtual const faceList & faces() const
Return raw faces.
label whichPatch(const label meshFacei) const
Return patch index for a given mesh face index. Uses binary search.
errorManip< error > abort(error &err)
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO...
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
const faceZoneMesh & faceZones() const noexcept
Return face zone mesh.
const edgeList & edges() const
Return mesh edges. Uses calcEdges.
const vectorField & faceCentres() const
T get(const label index) const
Get a value from the argument at index.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
const word & name() const noexcept
The zone name.
const std::string patch
OpenFOAM patch number as a std::string.
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)
Reduce inplace (cf. MPI Allreduce) using specified communication schedule.
const boolList & flipMap() const noexcept
Return face flip map.
messageStream Info
Information stream (stdout output on master, null elsewhere)
A subset of mesh faces organised as a primitive patch.
label nBoundaryFaces() const noexcept
Number of boundary faces (== nFaces - nInternalFaces)
Foam::argList args(argc, argv)
A List with indirect addressing.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
static constexpr const zero Zero
Global zero (0)