54 globalPointLabel = -1;
77 forAll(procBoundaries, patchI)
79 const label start = procBoundaries[patchI].patchStart();
80 const label end = start + procBoundaries[patchI].patchSize();
81 for(
label faceI=start;faceI<end;++faceI)
90 procBoundaries[patchI].myProcNo()
95 procBoundaries[patchI].neiProcNo()
108 forAll(procBoundaries, patchI)
110 const label start = procBoundaries[patchI].patchStart();
111 const label end = start + procBoundaries[patchI].patchSize();
115 for(
label faceI=start;faceI<end;++faceI)
119 if( (
bp[
f[pI]] != -1) && !addedPoint.
found(
f[pI]) )
139 procBoundaries[patchI].neiProcNo(),
145 forAll(procBoundaries, patchI)
150 procBoundaries[patchI].neiProcNo()
153 fromOtherProc >> receivedData;
155 const label start = procBoundaries[patchI].patchStart();
158 while( counter < receivedData.size() )
160 const face&
f =
faces[start+receivedData[counter++]];
161 const label pI = receivedData[counter++];
162 const label nProcs = receivedData[counter++];
163 for(
label i=0;i<nProcs;++i)
165 const label neiProc = receivedData[counter++];
176 }
while( !finished );
179 label nLocalPoints(0);
195 localPoints[bpI] =
false;
210 startPoint += nPointsAtProc[i];
213 if( localPoints[pI] )
214 globalPointLabel[pI] = startPoint++;
221 forAll(procBoundaries, patchI)
223 const label start = procBoundaries[patchI].patchStart();
224 const label end = start + procBoundaries[patchI].patchSize();
228 for(
label faceI=start;faceI<end;++faceI)
234 if( (bpI != -1) && (globalPointLabel[bpI] != -1) )
236 if( addedPoint.
found(bpI) )
246 dts.
append(globalPointLabel[bpI]);
254 procBoundaries[patchI].neiProcNo(),
260 forAll(procBoundaries, patchI)
265 procBoundaries[patchI].neiProcNo()
268 fromOtherProc >> receivedData;
270 const label start = procBoundaries[patchI].patchStart();
273 while( counter < receivedData.size() )
275 const face&
f =
faces[start+receivedData[counter++]];
276 const label pI = receivedData[counter++];
277 const label globalLabel = receivedData[counter++];
279 if( globalPointLabel[
bp[
f[pI]]] == -1 )
281 globalPointLabel[
bp[
f[pI]]] = globalLabel;
284 else if( globalPointLabel[
bp[
f[pI]]] != globalLabel )
288 "void meshSurfaceEngine::"
289 "calcGlobalBoundaryPointLabels() const"
290 ) <<
"Point labels in proc boundary "
291 << procBoundaries[patchI].patchName()
292 <<
" face " <<
f <<
" pI = " << pI
293 <<
nl <<
" label " << globalPointLabel[
bp[
f[pI]]]
294 <<
nl <<
" other global label " << globalLabel
301 }
while( !finished );
332 globalEdgeLabel = -1;
355 typedef std::set<std::pair<label, label> > procEdgeMap;
358 forAll(procBoundaries, patchI)
360 const label start = procBoundaries[patchI].patchStart();
361 const label end = start + procBoundaries[patchI].patchSize();
362 for(
label faceI=start;faceI<end;++faceI)
368 if(
bp[
f[eI]] != -1 )
370 const edge e =
f.faceEdge(eI);
375 if( bEdges[pEdges(bpI, peI)] ==
e )
377 edgeI = pEdges(bpI, peI);
383 facesWithProcBndEdges[patchI].insert
385 std::make_pair(faceI, eI)
391 procBoundaries[patchI].myProcNo()
396 procBoundaries[patchI].neiProcNo()
411 forAll(facesWithProcBndEdges, patchI)
413 const label start = procBoundaries[patchI].patchStart();
414 const procEdgeMap& procBndEdges = facesWithProcBndEdges[patchI];
419 const std::pair<label, label>& fPair = *it;
422 const edge e =
f.faceEdge(fPair.second);
424 if(
bp[
e.start()] != -1 )
429 if( bEdges[pEdges(bpI, peI)] ==
e )
431 edgeI = pEdges(bpI, peI);
442 dts.
append(fPair.first-start);
443 dts.
append((
f.size()-fPair.second-1)%
f.size());
454 procBoundaries[patchI].neiProcNo(),
460 forAll(procBoundaries, patchI)
465 procBoundaries[patchI].neiProcNo()
468 fromOtherProc >> receivedData;
470 const label start = procBoundaries[patchI].patchStart();
473 while( counter < receivedData.size() )
475 const label faceI = start+receivedData[counter++];
477 const label eI = receivedData[counter++];
479 const edge e =
f.faceEdge(eI);
482 if( bEdges[pEdges(
bp[
e.start()], peI)] ==
e )
483 edgeI = pEdges(
bp[
e.start()], peI);
485 const label nProcs = receivedData[counter++];
486 for(
label i=0;i<nProcs;++i)
488 const label neiProc = receivedData[counter++];
491 facesWithProcBndEdges[patchI].insert
493 std::make_pair(faceI, eI)
504 }
while( !finished );
507 label nLocalEdges(0);
523 localEdges[bpI] =
false;
538 startEdge += nEdgesAtProc[i];
542 globalEdgeLabel[pI] = startEdge++;
549 forAll(facesWithProcBndEdges, patchI)
551 const label start = procBoundaries[patchI].patchStart();
552 const procEdgeMap& procBndEdges = facesWithProcBndEdges[patchI];
557 const label faceI = it->first;
560 const label eI = it->second;
561 const edge e =
f.faceEdge(eI);
563 if(
bp[
e.start()] != -1 )
568 if( bEdges[pEdges(bpI, peI)] ==
e )
570 edgeI = pEdges(bpI, peI);
574 if( (edgeI != -1) && (globalEdgeLabel[edgeI] != -1) )
581 dts.
append((
f.size()-eI-1)%
f.size());
582 dts.
append(globalEdgeLabel[edgeI]);
590 procBoundaries[patchI].neiProcNo(),
596 forAll(procBoundaries, patchI)
601 procBoundaries[patchI].neiProcNo()
604 fromOtherProc >> receivedData;
606 const label start = procBoundaries[patchI].patchStart();
609 while( counter < receivedData.size() )
611 const face&
f =
faces[start+receivedData[counter++]];
612 const label eI = receivedData[counter++];
614 const edge e =
f.faceEdge(eI);
617 if( bEdges[pEdges(
bp[
e.start()], peI)] ==
e )
618 edgeI = pEdges(
bp[
e.start()], peI);
620 const label globalLabel = receivedData[counter++];
622 if( globalEdgeLabel[edgeI] == -1 )
624 globalEdgeLabel[edgeI] = globalLabel;
627 else if( globalEdgeLabel[edgeI] != globalLabel )
631 "void meshSurfaceEngine::"
632 "calcGlobalBoundaryEdgeLabels() const"
639 }
while( !finished );
670 std::map<label, labelLongList> exchangeData;
678 const label beI = iter();
679 nFacesAtEdge.insert(beI, eFaces.
sizeOfRow(beI));
696 for(
label counter=0;counter<receivedData.
size();)
698 const label beI = globalToLocal[receivedData[counter++]];
699 nFacesAtEdge[beI] += receivedData[counter++];
707 "void meshSurfaceEngine::calcAddressingForProcEdges() const"
708 ) <<
"Surface is not manifold at boundary edge "
714 exchangeData.clear();
720 const label beI = iter();
731 exchangeData[neiProc].append(globalEdgeLabel[beI]);
732 exchangeData[neiProc].append
741 std::map<label, labelList> receivedMap;
751 std::map<label, labelList>::const_iterator iter=receivedMap.begin();
752 iter!=receivedMap.end();
756 const labelList& receivedData = iter->second;
759 while( counter < receivedData.
size() )
761 const label beI = globalToLocal[receivedData[counter++]];
762 const label patch = receivedData[counter++];
765 otherProcPatches.insert(beI, patch);
766 otherFaceProc.insert(beI, iter->first);
788 startFace += nFacesAtProc[i];
791 globalFaceLabel[fI] = startFace++;