47 int main(
int argc,
char *argv[])
60 Info<<
"Orienting faceZone " << zoneName
61 <<
" such that " << outsidePoint <<
" is outside"
65 const faceZone& fZone = mesh.faceZones()[zoneName];
70 <<
"Face zone " << fZone.
name()
71 <<
" is not parallel synchronised."
72 <<
" Any coupled face also needs its coupled version to be included"
73 <<
" and with opposite flipMap."
100 label nProtected = 0;
104 const label meshFacei = faceLabels[facei];
111 && !isMasterFace[meshFacei]
120 Info<<
"Protected from visiting "
122 <<
" slaves of coupled faces" <<
nl <<
endl;
126 labelList nMasterFaces(patch.nEdges(), 0);
130 const label meshFacei = faceLabels[facei];
132 if (isMasterFace[meshFacei])
134 const labelList& fEdges = patch.faceEdges()[facei];
137 nMasterFaces[fEdges[fEdgeI]]++;
145 patch.meshEdges(mesh.edges(), mesh.pointEdges()),
152 label nProtected = 0;
154 forAll(nMasterFaces, edgeI)
156 if (nMasterFaces[edgeI] > 2)
163 Info<<
"Protected from visiting "
165 <<
" non-manifold edges" <<
nl <<
endl;
187 forAll(allFaceInfo, facei)
191 unsetFacei = globalFaces.toGlobal(facei);
203 label proci = globalFaces.whichProcID(unsetFacei);
204 label seedFacei = globalFaces.toLocal(proci, unsetFacei);
205 Info<<
"Seeding from processor " << proci <<
" face " << seedFacei
212 vector d = outsidePoint-patch.faceCentres()[seedFacei];
213 const vector& fn = patch.faceNormals()[seedFacei];
223 Pout<<
"Face " << seedFacei <<
" at "
224 << patch.faceCentres()[seedFacei]
225 <<
" with normal " << fn
226 <<
" needs to be flipped." <<
endl;
230 Pout<<
"Face " << seedFacei <<
" at "
231 << patch.faceCentres()[seedFacei]
232 <<
" with normal " << fn
233 <<
" points in positive direction (cos = " << (fn&d)/
mag(d)
238 const labelList& fEdges = patch.faceEdges()[seedFacei];
241 label edgeI = fEdges[fEdgeI];
259 changedEdges.
append(edgeI);
260 changedInfo.
append(edgeInfo);
297 mesh.nFaces()-mesh.nInternalFaces(),
303 const label meshFacei = faceLabels[i];
304 if (!mesh.isInternalFace(meshFacei))
306 neiStatus[meshFacei-mesh.nInternalFaces()] =
307 allFaceInfo[i].flipStatus();
314 const label meshFacei = faceLabels[i];
321 && !isMasterFace[meshFacei]
325 label bFacei = meshFacei-mesh.nInternalFaces();
338 <<
"Incorrect status for face " << meshFacei
348 boolList newFlipMap(allFaceInfo.size(),
false);
350 forAll(allFaceInfo, facei)
354 newFlipMap[facei] =
false;
358 newFlipMap[facei] =
true;
363 <<
"Problem : unvisited face " << facei
364 <<
" centre:" << mesh.faceCentres()[faceLabels[facei]]
368 if (fZone.
flipMap()[facei] != newFlipMap[facei])
377 Info<<
"Flipping " << nChanged <<
" out of "
378 << globalFaces.size() <<
" faces." <<
nl <<
endl;
380 mesh.faceZones()[zoneName].resetAddressing(faceLabels, newFlipMap);
381 if (!mesh.faceZones().write())
#define forAll(list, i)
Loop across all elements in list.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
A List with indirect addressing.
void size(const label)
Override size to be inconsistent with allocated storage.
Wave propagation of information along patch. Every iteration information goes through one layer of fa...
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
const word & name() const
Return name.
static SLList< string > validArgs
A list of valid (mandatory) arguments.
T argRead(const label index) const
Read a value from the argument at index.
A subset of mesh faces organised as a primitive patch.
const boolList & flipMap() const
Return face flip map.
bool checkParallelSync(const bool report=false) const
Check whether all procs have faces synchronised. Return.
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
Transport of orientation for use in PatchEdgeFaceWave.
void flip()
Reverse 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.
label whichPatch(const label faceIndex) const
Return patch index for a given face label.
A class for handling words, derived from string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
int main(int argc, char *argv[])
errorManipArg< error, int > exit(error &err, const int errNo=1)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
errorManip< error > abort(error &err)
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
dimensioned< scalar > mag(const dimensioned< Type > &)
prefixOSstream Pout(cout, "Pout")
static const label labelMax
PrimitivePatch< IndirectList< face >, const pointField & > indirectPrimitivePatch
Foam::indirectPrimitivePatch.
Foam::argList args(argc, argv)