7 viewFactorDict.lookupOrDefault<
label>(
"maxDynListLength", 100000)
10 for (
label proci = 0; proci < Pstream::nProcs(); proci++)
15 DynamicField<point> start(coarseMesh.nFaces());
16 DynamicField<point> end(start.size());
17 DynamicList<label> startIndex(start.size());
18 DynamicList<label> endIndex(start.size());
20 DynamicList<label> startAgg(start.size());
21 DynamicList<label> endAgg(start.size());
24 const pointField& myFc = remoteCoarseCf[Pstream::myProcNo()];
25 const vectorField& myArea = remoteCoarseSf[Pstream::myProcNo()];
26 const labelField& myAgg = remoteCoarseAgg[Pstream::myProcNo()];
28 const pointField& remoteArea = remoteCoarseSf[proci];
29 const pointField& remoteFc = remoteCoarseCf[proci];
30 const labelField& remoteAgg = remoteCoarseAgg[proci];
36 for (; i < myFc.size(); i++)
38 const point& fc = myFc[i];
39 const vector& fA = myArea[i];
40 const label& fAgg = myAgg[i];
42 for (; j < remoteFc.size(); j++)
44 if (proci != Pstream::myProcNo() || i != j)
46 const point& remFc = remoteFc[j];
47 const vector& remA = remoteArea[j];
48 const label& remAgg = remoteAgg[j];
50 const vector d(remFc - fc);
52 if (((d & fA) < 0.) && ((d & remA) > 0))
54 start.append(fc + 0.001*d);
56 startAgg.append(globalNumbering.toGlobal(proci, fAgg));
57 end.append(fc + 0.999*d);
58 label globalI = globalNumbering.toGlobal(proci, j);
59 endIndex.append(globalI);
60 endAgg.append(globalNumbering.toGlobal(proci, remAgg));
64 <<
"Dynamic list need from capacity." 65 <<
"Actual size maxDynListLength : " 73 if (j == remoteFc.size())
81 List<pointIndexHit> hitInfo(startIndex.size());
88 DynamicList<label> dRayIs;
94 if (!hitInfo[rayI].hit())
96 rayStartFace.append(startIndex[rayI]);
97 rayEndFace.append(endIndex[rayI]);
99 else if (aggHitIndex[rayI] == startAgg[rayI])
111 bool firstLoop =
true;
112 DynamicField<point> startHitItself;
113 DynamicField<point> endHitItself;
123 const label rayID = rayIs[rayI];
128 hitIndex = rayIs[rayI];
135 if (hitInfo[hitIndex].hit())
137 if (aggHitIndex[hitIndex] == startAgg[rayID])
139 const vector& endP = end[rayID];
140 const vector& startP = hitInfo[hitIndex].hitPoint();
141 const vector d(endP - startP);
143 startHitItself.append(startP + 0.01*d);
144 endHitItself.append(startP + 1.01*d);
146 dRayIs.append(rayID);
148 else if (aggHitIndex[hitIndex] == endAgg[rayID])
150 rayStartFace.append(startIndex[rayID]);
151 rayEndFace.append(endIndex[rayID]);
158 hitInfo.resize(dRayIs.size());
160 surfacesMesh.findLine(startHitItself, endHitItself, hitInfo);
165 endHitItself.clear();
166 startHitItself.clear();
170 }
while (
returnReduce(hitInfo.size(), orOp<bool>()) > 0 && iter < 10);
Field< label > labelField
Specialisation of Field<T> for label.
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
distributedTriSurfaceMesh surfacesMesh(IOobject("wallSurface.stl", runTime.constant(), searchableSurface::geometryDir(runTime), runTime, IOobject::NO_READ, IOobject::NO_WRITE), localSurface, dict)
volVectorField vectorField(fieldObject, mesh)
Vector< scalar > vector
A scalar version of the templated Vector.
vectorField pointField
pointField is a vectorField.
List< label > labelList
A List of labels.
errorManip< error > abort(error &err)
vector point
Point is a vector.
const label maxDynListLength(viewFactorDict.lookupOrDefault< label >("maxDynListLength", 100000))
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
void transfer(List< T > &)
Transfer the contents of the argument List into this list.