51 const label ownerProc,
61 label ownerIndex = facei+1;
62 label nbrIndex = -(facei+1);
64 if (patchIter != nbrToInterPatch[ownerProc].end())
67 label toNbrProcPatchI = patchIter();
68 interPatchFaces[ownerProc][toNbrProcPatchI].append(ownerIndex);
70 if (isInternalFace(facei))
72 label toOwnerProcPatchI = nbrToInterPatch[nbrProc][ownerProc];
73 interPatchFaces[nbrProc][toOwnerProcPatchI].append(nbrIndex);
79 label toNbrProcPatchI = nbrToInterPatch[ownerProc].size();
80 nbrToInterPatch[ownerProc].insert(nbrProc, toNbrProcPatchI);
82 oneFace.
append(ownerIndex);
83 interPatchFaces[ownerProc].append(oneFace);
85 if (isInternalFace(facei))
87 label toOwnerProcPatchI = nbrToInterPatch[nbrProc].size();
88 nbrToInterPatch[nbrProc].insert(ownerProc, toOwnerProcPatchI);
91 interPatchFaces[nbrProc].append(oneFace);
105 Info<<
"\nCalculating original mesh data" <<
endl;
111 const labelList& neighbour = faceNeighbour();
116 Info<<
"\nDistributing cells to processors" <<
endl;
121 Info<<
"\nDistributing faces to processors" <<
endl;
128 procFaceAddressing_.setSize(nProcs_);
133 if (cellToProc_[owner[facei]] == cellToProc_[neighbour[facei]])
136 procFaceAddressing_[cellToProc_[owner[facei]]].append(facei+1);
142 forAll(procPatchSize_, procI)
144 procPatchSize_[procI].setSize(
patches.size());
145 procPatchStartIndex_[procI].setSize(
patches.size());
151 forAll(procPatchSize_, procI)
153 procPatchSize_[procI][
patchi] = 0;
154 procPatchStartIndex_[procI][
patchi] =
155 procFaceAddressing_[procI].size();
168 forAll(patchFaceCells, facei)
170 const label curProc = cellToProc_[patchFaceCells[facei]];
173 procFaceAddressing_[curProc].append(patchStart+facei+1);
176 procPatchSize_[curProc][
patchi]++;
191 forAll(patchFaceCells, facei)
193 const label curProc = cellToProc_[patchFaceCells[facei]];
194 const label nbrProc = cellToProc_[nbrPatchFaceCells[facei]];
195 if (curProc == nbrProc)
198 procFaceAddressing_[curProc].append(patchStart+facei+1);
200 procPatchSize_[curProc][
patchi]++;
220 label ownerProc = cellToProc_[owner[facei]];
221 label nbrProc = cellToProc_[neighbour[facei]];
223 if (ownerProc != nbrProc)
242 forAll(interPatchFaces, procI)
244 label nInterfaces = interPatchFaces[procI].
size();
321 forAll(procNbrToInterPatch, procI)
323 label nInterfaces = procNbrToInterPatch[procI].
size();
325 procNeighbourProcessors_[procI].setSize(nInterfaces);
326 procProcessorPatchSize_[procI].setSize(nInterfaces);
327 procProcessorPatchStartIndex_[procI].setSize(nInterfaces);
328 procProcessorPatchSubPatchIDs_[procI].setSize(nInterfaces);
329 procProcessorPatchSubPatchStarts_[procI].setSize(nInterfaces);
334 const Map<label>& curNbrToInterPatch = procNbrToInterPatch[procI];
335 labelList nbrs = curNbrToInterPatch.toc();
340 interPatchFaces[procI];
344 const label nbrProc = nbrs[i];
345 const label interPatch = curNbrToInterPatch[nbrProc];
347 procNeighbourProcessors_[procI][i] = nbrProc;
348 procProcessorPatchSize_[procI][i] =
349 curInterPatchFaces[interPatch].size();
350 procProcessorPatchStartIndex_[procI][i] =
351 procFaceAddressing_[procI].size();
356 subPatchStarts[procI][interPatch],
357 curInterPatchFaces[interPatch].size()
359 procProcessorPatchSubPatchIDs_[procI][i].transfer
361 subPatchIDs[procI][interPatch]
363 procProcessorPatchSubPatchStarts_[procI][i].transfer
365 subPatchStarts[procI][interPatch]
381 curInterPatchFaces[interPatch];
383 forAll(interPatchFaces, j)
385 procFaceAddressing_[procI].append(interPatchFaces[j]);
390 procFaceAddressing_[procI].shrink();
438 Info<<
"\nDistributing points to processors" <<
endl;
444 forAll(procPointAddressing_, procI)
449 const labelList& procFaceLabels = procFaceAddressing_[procI];
451 forAll(procFaceLabels, facei)
454 const labelList& facePoints = fcs[
mag(procFaceLabels[facei]) - 1];
456 forAll(facePoints, pointi)
464 labelList& procPointLabels = procPointAddressing_[procI];
468 label nUsedPoints = 0;
474 procPointLabels[nUsedPoints] = pointi;
481 procPointLabels.
setSize(nUsedPoints);