31 template<
typename Po
intType>
40 autoPtr<mapDistribute> map(
buildMap(toProc));
48 template<
typename Po
intType>
54 DynamicList<label> toCandidateProc;
55 DynamicList<point> testPoints;
59 label nTotalCandidates = 0;
65 label nCandidates = 0;
67 forAll(allBackgroundMeshBounds_, procI)
69 if (allBackgroundMeshBounds_[procI].contains(pt))
71 toCandidateProc.append(procI);
72 testPoints.append(pt);
78 ptBlockStart[pI] = nTotalCandidates;
79 ptBlockSize[pI] = nCandidates;
81 nTotalCandidates += nCandidates;
85 label preDistributionToCandidateProcSize = toCandidateProc.size();
87 autoPtr<mapDistribute> map(buildMap(toCandidateProc));
89 map().distribute(testPoints);
91 List<bool> pointOnCandidate(testPoints.size(),
false);
96 pointOnCandidate[tPI] = positionOnThisProcessor(testPoints[tPI]);
99 map().reverseDistribute
101 preDistributionToCandidateProcSize,
107 DynamicList<label> failedPointIndices;
108 DynamicList<point> failedPoints;
114 SubList<bool> ptProcResults
121 forAll(ptProcResults, pPRI)
123 if (ptProcResults[pPRI])
125 ptProc[pI] = toCandidateProc[ptBlockStart[pI] + pPRI];
135 if (!globalBackgroundBounds_.contains(pt))
138 <<
"The position " << pt
139 <<
" is not in any part of the background mesh "
140 << globalBackgroundBounds_ <<
endl
141 <<
"A background mesh with a wider margin around "
142 <<
"the geometry may help."
149 <<
"The position " << pt
150 <<
" was not found in the background mesh "
151 << globalBackgroundBounds_ <<
", finding nearest."
155 failedPointIndices.append(pI);
156 failedPoints.append(pt);
160 labelList ptNearestProc(processorNearestPosition(failedPoints));
164 label pI = failedPointIndices[fPI];
166 ptProc[pI] = ptNearestProc[fPI];