54 const direction useType = SMOOTH + BOUNDARY;
57 if( !globalPointLabelPtr_ )
60 globalTetPointLabel.
setSize(points_.size());
61 globalTetPointLabel = -1;
71 if( !globalToLocalPointAddressingPtr_ )
72 globalToLocalPointAddressingPtr_ =
new Map<label>();
73 Map<label>& globalToLocal = *globalToLocalPointAddressingPtr_;
74 globalToLocal.clear();
77 if( !pAtParallelBoundariesPtr_ )
79 labelLongList& pAtParallelBoundaries = *pAtParallelBoundariesPtr_;
80 pAtParallelBoundaries.
clear();
83 std::map<label, labelLongList> exchangeData;
84 std::map<label, labelLongList>::iterator iter;
87 const Map<label>& globalToLocalPointAddressing =
93 exchangeData.insert(std::make_pair(pNeiProcs[procI],
labelLongList()));
100 const label pI = it();
103 nodeLabelForPoint[pI] == -1 ||
104 !smoothVertex_[nodeLabelForPoint[pI]]
109 const label neiProc = pAtProcs(pI, procI);
113 exchangeData[neiProc].append(it.key());
125 const label pointI = globalToLocalPointAddressing[receivedData[i]];
127 if( nodeLabelForPoint[pointI] == -1 )
130 smoothVertex_[nodeLabelForPoint[pointI]] = NONE;
133 for(iter=exchangeData.begin();iter!=exchangeData.end();++iter)
134 iter->second.clear();
138 label startPoint(0), nLocalPoints(0), nSharedPoints(0);
143 const label pI = it();
145 if( nodeLabelForPoint[pI] == -1 )
147 if( !(smoothVertex_[nodeLabelForPoint[pI]] & useType) )
161 nSharedPoints -= nLocalPoints;
167 startPoint += nPointsAtProc[i];
172 const label pI = it();
174 if( nodeLabelForPoint[pI] == -1 )
177 const label pLabel = nodeLabelForPoint[pI];
179 if( !(smoothVertex_[pLabel] & useType) )
185 const label neiProc = pAtProcs(pI, procI);
186 pProcs.
append(pLabel, neiProc);
193 globalTetPointLabel[pLabel] = startPoint++;
197 const label neiProc = pAtProcs(pI, procI);
205 exchangeData[neiProc].append(it.key());
206 exchangeData[neiProc].append(globalTetPointLabel[pLabel]);
211 receivedData.
clear();
215 while( counter < receivedData.
size() )
217 const label gpI = receivedData[counter++];
218 const label tgI = receivedData[counter++];
220 nodeLabelForPoint[globalToLocalPointAddressing[gpI]];
222 globalTetPointLabel[pLabel] = tgI;
226 forAll(globalTetPointLabel, pI)
228 if( globalTetPointLabel[pI] == -1 )
229 globalTetPointLabel[pI] = startPoint++;
233 forAll(globalTetPointLabel, pI)
237 pAtParallelBoundaries.
append(pI);
238 globalToLocal.insert(globalTetPointLabel[pI], pI);
244 if( (smoothVertex_[pI] & useType) && (pProcs.
sizeOfRow(pI) != 0) )
245 smoothVertex_[pI] |= PARALLELBOUNDARY;
252 for(iter=exchangeData.begin();iter!=exchangeData.end();++iter)
253 neiProcs.
append(iter->first);
260 Pout <<
"globalTetPointLabel " << globalTetPointLabel <<
endl;
268 forAll(nodeLabelForPoint, pI)
270 const label tpI = nodeLabelForPoint[pI];
271 if( tpI != -1 && globalTetPointLabel[tpI] == -1 )
277 forAll(nodeLabelForFace, fI)
279 const label tpI = nodeLabelForFace[fI];
280 if( tpI != -1 && globalTetPointLabel[tpI] == -1 )
282 Pout <<
"Face point " << tpI <<
" is at procs "
283 << pProcs[tpI] <<
endl;
290 forAll(nodeLabelForCell, cI)
292 const label tpI = nodeLabelForCell[cI];
293 if( tpI != -1 && globalTetPointLabel[tpI] == -1 )
299 Pout <<
"Point " << globalTetPointLabel[vI]
300 <<
" is at par bnd" <<
endl;
310 <<
" is at procs " << pProcs[pI] <<
" n tets "
328 pAtBufferLayers.
clear();
331 std::map<label, LongList<parPartTet> > exchangeTets;
347 const label pLabel = pt[i];
353 const label neiProc = pProcs(pLabel, i);
363 if( sendToProcs.
size() )
375 exchangeTets[sendToProcs[i]].append(tet);
380 pAtBufferLayers.
append(pt[j]);
390 exchangeTets.clear();
398 for(
label j=0;j<4;++j)
400 const label gpI = tet[j].pointLabel();
402 if( globalToLocal.found(gpI) )
404 const label pI = globalToLocal[gpI];
406 tetPointLabels.
append(pI);
408 else if( newGlobalToLocal.found(gpI) )
410 tetPointLabels.
append(newGlobalToLocal[gpI]);
414 newGlobalToLocal.insert(gpI,
points_.size());
423 globalTetPointLabel.
append(gpI);
445 globalToLocal.insert(it.key(), it());
455 if( it() < pProcs.
size() )
457 np.
append(pProcs(it(), j));
459 Pout <<
"Tet mesh point " << it() <<
" has global label "
460 << it.key() <<
" and is located at procs "