36 Foam::label Foam::advancingFrontAMI::calcOverlappingProcs
38 const List<treeBoundBoxList>& procBb,
39 const treeBoundBox& bb,
43 overlaps.setSize(procBb.size());
52 for (
const treeBoundBox& tbb: bbp)
56 overlaps[proci] =
true;
67 void Foam::advancingFrontAMI::distributePatches
69 const mapDistribute& map,
71 const globalIndex& gi,
72 List<faceList>& faces,
74 List<labelList>& faceIDs
81 const labelList& sendElems = map.subMap()[domain];
85 faceList subFaces(UIndirectList<face>(pp, sendElems));
88 SubList<face>(subFaces, subFaces.size()),
94 Pout<<
"distributePatches: to processor " << domain
95 <<
" sending faces " << subPatch.faceCentres() <<
endl;
98 UOPstream toDomain(domain, pBufs);
100 << subPatch.localFaces() << subPatch.localPoints()
101 << gi.toGlobal(sendElems);
106 pBufs.finishedSends();
115 faceList subFaces(UIndirectList<face>(pp, sendElems));
118 SubList<face>(subFaces, subFaces.size()),
126 <<
" sending faces " << subPatch.faceCentres() <<
endl;
137 const labelList& recvElems = map.constructMap()[domain];
141 UIPstream str(domain, pBufs);
151 void Foam::advancingFrontAMI::distributeAndMergePatches
153 const mapDistribute& map,
155 const globalIndex& gi,
162 List<faceList> allFaces;
164 List<labelList> allTgtFaceIDs;
165 distributePatches(map, tgtPatch, gi, allFaces,
allPoints, allTgtFaceIDs);
172 nFaces += allFaces[proci].size();
176 tgtFaces.setSize(nFaces);
178 tgtFaceIDs.setSize(nFaces);
186 SubList<label>(tgtFaceIDs, faceIDs.size()) = faceIDs;
189 for (
const face&
f : fcs)
191 face& newF = tgtFaces[nFaces++];
200 for (
const point& pt: pts)
212 const labelList& faceIDs = allTgtFaceIDs[proci];
213 SubList<label>(tgtFaceIDs, faceIDs.size(), nFaces) = faceIDs;
215 const faceList& fcs = allFaces[proci];
216 for (
const face&
f : fcs)
218 face& newF = tgtFaces[nFaces++];
227 for (
const point& pt: pts)
250 Pout<<
"Merged from " << tgtPoints.size()
251 <<
" down to " << newTgtPoints.size() <<
" points" <<
endl;
254 tgtPoints.transfer(newTgtPoints);
255 for (face&
f : tgtFaces)
277 srcPatch.localFaces(),
278 srcPatch.localPoints(),
292 Info<<
"Determining extent of srcPatch per processor:" <<
nl
293 <<
"\tproc\tbb" <<
endl;
296 Info<<
'\t' << proci <<
'\t' << procBb[proci] <<
endl;
301 const faceList& faces = tgtPatch.localFaces();
315 if (faces[facei].size())
317 treeBoundBox faceBb(
points, faces[facei]);
320 calcOverlappingProcs(procBb, faceBb, procBbOverlaps);
322 forAll(procBbOverlaps, proci)
324 if (procBbOverlaps[proci])
326 dynSendMap[proci].append(facei);
336 sendMap[proci].transfer(dynSendMap[proci]);
343 Pout<<
"Of my " << faces.size() <<
" I need to send to:" <<
nl
344 <<
"\tproc\tfaces" <<
endl;
347 Pout<<
'\t' << proci <<
'\t' << sendMap[proci].size() <<
endl;
373 forAll(constructMap, proci)
379 constructMap[proci].setSize(nRecv);
381 for (label i = 0; i < nRecv; ++i)
383 constructMap[proci][i] = segmentI++;
392 std::move(constructMap)