7 Info<<
"\nShooting rays using distributedTriSurfaceMesh (no CGAL support)" 16 viewFactorDict.getOrDefault<label>(
"maxDynListLength", 1000000)
19 for (
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())
90 List<pointIndexHit> hitInfo(startIndex.size());
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])
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();
Field< label > labelField
Specialisation of Field<T> for label.
const label maxDynListLength(viewFactorDict.getOrDefault< label >("maxDynListLength", 1000000))
void transfer(List< T > &list)
Transfer the contents of the argument List into this list and annul the argument list.
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.
Ostream & endl(Ostream &os)
Add newline and flush stream.
distributedTriSurfaceMesh surfacesMesh(IOobject("wallSurface.stl", runTime.constant(), "triSurface", runTime, IOobject::NO_READ, IOobject::NO_WRITE), localSurface, dict)
#define forAll(list, i)
Loop across all elements in list.
vectorField pointField
pointField is a vectorField.
errorManip< error > abort(error &err)
constexpr auto end(C &c) -> decltype(c.end())
Return iterator to the end of the container c.
vector point
Point is a vector.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Field< vector > vectorField
Specialisation of Field<T> for vector.
List< label > labelList
A List of labels.
bool returnReduceOr(const bool value, const label comm=UPstream::worldComm)
Perform logical (or) MPI Allreduce on a copy. Uses UPstream::reduceOr.