53int 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."
101 List<patchFaceOrientation> allEdgeInfo(
patch.nEdges());
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;
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);
310 if (!
mesh.isInternalFace(meshFacei))
312 neiStatus[meshFacei-
mesh.nInternalFaces()] =
321 const label patchi = bm.
whichPatch(meshFacei);
327 && !isMasterFace[meshFacei]
331 label bFacei = meshFacei-
mesh.nInternalFaces();
344 <<
"Incorrect status for face " << meshFacei
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;
386 mesh.faceZones()[zoneName].resetAddressing(
faceLabels, newFlipMap);
387 if (!
mesh.faceZones().write())
labelList faceLabels(nFaceLabels)
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
void append(const T &val)
Copy append an element to the end of this list.
A List with indirect addressing.
Wave propagation of information along patch. Every iteration information goes through one layer of fa...
bool empty() const noexcept
True if List is empty (ie, size() is zero).
static int myProcNo(const label communicator=worldComm)
Rank of this process in the communicator (starting from masterNo()). Negative if the process is not a...
static void addArgument(const string &argName, const string &usage="")
Append a (mandatory) argument to validArgs.
static void addNote(const string ¬e)
Add extra notes for the usage information.
A subset of mesh faces organised as a primitive patch.
const boolList & flipMap() const noexcept
Return face flip map.
virtual bool checkParallelSync(const bool report=false) const
Check whether all procs have faces synchronised.
Calculates a non-overlapping list of offsets based on an input size (eg, number of cells) from differ...
Transport of orientation for use in PatchEdgeFaceWave.
void flip()
Reverse the orientation.
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 polyBoundaryMesh is a polyPatch list with registered IO, a reference to the associated polyMesh,...
label whichPatch(const label meshFacei) const
Return patch index for a given mesh face index. Uses binary search.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
A class for handling words, derived from Foam::string.
const word & name() const noexcept
The zone name.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
List< wallPoints > allFaceInfo(mesh_.nFaces())
return returnReduce(nRefine-oldNRefine, sumOp< label >())
const std::string patch
OpenFOAM patch number as a std::string.
List< label > labelList
A List of labels.
messageStream Info
Information stream (stdout output on master, null elsewhere).
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
void reduce(T &value, BinaryOp bop, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm)
Reduce inplace (cf. MPI Allreduce).
bool returnReduceAnd(const bool value, const int communicator=UPstream::worldComm)
Perform logical (and) MPI Allreduce on a copy. Uses UPstream::reduceAnd.
PrimitivePatch< IndirectList< face >, const pointField & > indirectPrimitivePatch
A PrimitivePatch with an IndirectList for the faces, const reference for the point field.
errorManip< error > abort(error &err)
vector point
Point is a vector.
List< bool > boolList
A List of bools.
static constexpr const zero Zero
Global zero (0).
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a).
Foam::argList args(argc, argv)
#define forAll(list, i)
Loop across all elements in list.