19for (
const int proci : Pstream::allProcs())
24 DynamicField<point> start(coarseMesh.nFaces());
25 DynamicField<point> end(start.size());
26 DynamicList<label> startIndex(start.size());
27 DynamicList<label> endIndex(start.size());
29 DynamicList<label> startAgg(start.size());
30 DynamicList<label> endAgg(start.size());
33 const pointField& myFc = remoteCoarseCf[Pstream::myProcNo()];
34 const vectorField& myArea = remoteCoarseSf[Pstream::myProcNo()];
35 const labelField& myAgg = remoteCoarseAgg[Pstream::myProcNo()];
37 const pointField& remoteArea = remoteCoarseSf[proci];
38 const pointField& remoteFc = remoteCoarseCf[proci];
39 const labelField& remoteAgg = remoteCoarseAgg[proci];
45 for (; i < myFc.size(); i++)
47 const point& fc = myFc[i];
48 const vector& fA = myArea[i];
49 const label& fAgg = myAgg[i];
51 for (; j < remoteFc.size(); j++)
53 if (proci != Pstream::myProcNo() || i != j)
55 const point& remFc = remoteFc[j];
56 const vector& remA = remoteArea[j];
57 const label& remAgg = remoteAgg[j];
59 const vector d(remFc - fc);
61 if (((d & fA) < 0.) && ((d & remA) > 0))
63 start.append(fc + 0.001*d);
65 startAgg.append(globalNumbering.toGlobal(proci, fAgg));
66 end.append(fc + 0.999*d);
67 label globalI = globalNumbering.toGlobal(proci, j);
68 endIndex.append(globalI);
69 endAgg.append(globalNumbering.toGlobal(proci, remAgg));
73 <<
"Dynamic list need from capacity."
74 <<
"Actual size maxDynListLength : "
82 if (j == remoteFc.size())
88 }
while (returnReduceOr(i < myFc.size()));
90 List<pointIndexHit> hitInfo(startIndex.size());
94 labelList aggHitIndex;
97 DynamicList<label> dRayIs;
103 if (!hitInfo[rayI].hit())
105 rayStartFace.append(startIndex[rayI]);
106 rayEndFace.append(endIndex[rayI]);
108 else if (aggHitIndex[rayI] == startAgg[rayI])
120 bool firstLoop =
true;
121 DynamicField<point> startHitItself;
122 DynamicField<point> endHitItself;
132 const label rayID = rayIs[rayI];
137 hitIndex = rayIs[rayI];
144 if (hitInfo[hitIndex].hit())
146 if (aggHitIndex[hitIndex] == startAgg[rayID])
148 const vector& endP = end[rayID];
149 const vector& startP = hitInfo[hitIndex].point();
150 const vector& d = endP - startP;
152 startHitItself.append(startP + 0.01*d);
153 endHitItself.append(startP + 1.01*d);
155 dRayIs.append(rayID);
157 else if (aggHitIndex[hitIndex] == endAgg[rayID])
159 rayStartFace.append(startIndex[rayID]);
160 rayEndFace.append(endIndex[rayID]);
167 hitInfo.resize(dRayIs.size());
169 surfacesMesh.findLine(startHitItself, endHitItself, hitInfo);
174 endHitItself.clear();
175 startHitItself.clear();
179 }
while (returnReduceOr(hitInfo.size()) && iter < 10);
distributedTriSurfaceMesh surfacesMesh(IOobject("wallSurface.stl", runTime.constant(), "triSurface", runTime, IOobject::NO_READ, IOobject::NO_WRITE), localSurface, dict)