33 template<
class Po
intType>
42 autoPtr<mapDistribute> map(
buildMap(toProc));
50 template<
class Po
intType>
53 const List<PointType>& pts
56 DynamicList<label> toCandidateProc;
57 DynamicList<point> testPoints;
61 label nTotalCandidates = 0;
67 label nCandidates = 0;
69 forAll(allBackgroundMeshBounds_, proci)
71 if (allBackgroundMeshBounds_[proci].contains(pt))
73 toCandidateProc.append(proci);
74 testPoints.append(pt);
80 ptBlockStart[pI] = nTotalCandidates;
81 ptBlockSize[pI] = nCandidates;
83 nTotalCandidates += nCandidates;
87 label preDistributionToCandidateProcSize = toCandidateProc.size();
89 autoPtr<mapDistribute> map(buildMap(toCandidateProc));
91 map().distribute(testPoints);
93 List<bool> pointOnCandidate(testPoints.size(),
false);
98 pointOnCandidate[tPI] = positionOnThisProcessor(testPoints[tPI]);
101 map().reverseDistribute
103 preDistributionToCandidateProcSize,
109 DynamicList<label> failedPointIndices;
110 DynamicList<point> failedPoints;
116 SubList<bool> ptProcResults
123 forAll(ptProcResults, pPRI)
125 if (ptProcResults[pPRI])
127 ptProc[pI] = toCandidateProc[ptBlockStart[pI] + pPRI];
137 if (!globalBackgroundBounds_.contains(pt))
140 <<
"The position " << pt
141 <<
" is not in any part of the background mesh "
142 << globalBackgroundBounds_ <<
endl
143 <<
"A background mesh with a wider margin around "
144 <<
"the geometry may help."
151 <<
"The position " << pt
152 <<
" was not found in the background mesh "
153 << globalBackgroundBounds_ <<
", finding nearest."
157 failedPointIndices.append(pI);
158 failedPoints.append(pt);
162 labelList ptNearestProc(processorNearestPosition(failedPoints));
166 label pI = failedPointIndices[fPI];
168 ptProc[pI] = ptNearestProc[fPI];