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];
void size(const label n)
Older name for setAddressableSize.
pointFromPoint topoint(const Point &P)
errorManipArg< error, int > exit(error &err, const int errNo=1)
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.
static autoPtr< mapDistribute > buildMap(const List< label > &toProc)
Build a mapDistribute for the supplied destination processor data.
#define forAll(list, i)
Loop across all elements in list.
autoPtr< mapDistribute > distributePoints(List< PointType > &points) const
Distribute supplied the points to the appropriate processor.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
int debug
Static debugging option.
labelList processorPosition(const List< PointType > &pts) const
What processor is the given position on?
#define WarningInFunction
Report a warning using Foam::Warning.
List< label > labelList
A List of labels.