53 const labelList& owner = origMesh_.owner();
54 const labelList& neighbour = origMesh_.neighbour();
57 origMesh_.procBoundaries();
58 const label nInternalFaces = origMesh_.nInternalFaces();
66 if( useCell[owner[faceI]] )
69 if( neighbour[faceI] < 0 )
72 if( useCell[neighbour[faceI]] )
77 forAll(procBoundaries, patchI)
79 const label start = procBoundaries[patchI].patchStart();
80 const label size = procBoundaries[patchI].patchSize();
83 for(
label faceI=0;faceI<size;++faceI)
85 if( usedFace[start+faceI] )
92 procBoundaries[patchI].neiProcNo(),
96 toOtherProc << dataToSend;
100 forAll(procBoundaries, patchI)
107 procBoundaries[patchI].neiProcNo()
110 fromOtherProc >> receivedData;
112 const label start = procBoundaries[patchI].patchStart();
113 forAll(receivedData, faceI)
114 ++usedFace[start+receivedData[faceI]];
117 const vectorField& faceCentres = origMesh_.addressingData().faceCentres();
118 const vectorField& cellCentres = origMesh_.addressingData().cellCentres();
125 smoothVertex_.clear();
128 forAll(boundaries, patchI)
131 const label start = patch.patchStart();
132 const label end = start + patch.patchSize();
134 for(
label faceI=start;faceI<end;++faceI)
136 if( !usedFace[faceI] )
139 const face&
f = faces[faceI];
144 nodeLabelForFace[faceI] = points_.
size();
145 points_.append(faceCentres[faceI]);
146 smoothVertex_.append(FACECENTRE);
152 const label pointI =
f[pI];
153 if( nodeLabelForPoint[pointI] == -1 )
155 nodeLabelForPoint[pointI] = points_.
size();
156 points_.append(
points[pointI]);
158 smoothVertex_.append(BOUNDARY);
165 forAll(procBoundaries, patchI)
171 for(
label faceI=start;faceI<end;++faceI)
173 if( !usedFace[faceI] )
176 const face&
f = faces[faceI];
181 nodeLabelForFace[faceI] = points_.
size();
182 points_.append(faceCentres[faceI]);
183 smoothVertex_.append(FACECENTRE);
187 const direction vType = usedFace[faceI]==2?SMOOTH:NONE;
190 const label pointI =
f[pI];
191 if( nodeLabelForPoint[pointI] == -1 )
193 nodeLabelForPoint[pointI] = points_.
size();
194 points_.append(
points[pointI]);
196 smoothVertex_.append(vType);
198 else if( vType == NONE )
200 smoothVertex_[nodeLabelForPoint[pointI]] = NONE;
207 for(
label faceI=0;faceI<nInternalFaces;++faceI)
209 if( usedFace[faceI] )
211 const face&
f = faces[faceI];
216 nodeLabelForFace[faceI] = points_.
size();
217 points_.append(faceCentres[faceI]);
218 smoothVertex_.append(FACECENTRE);
222 const direction vType = usedFace[faceI]==2?SMOOTH:NONE;
225 const label pointI =
f[pI];
226 if( nodeLabelForPoint[pointI] == -1 )
228 nodeLabelForPoint[pointI] = points_.
size();
229 points_.append(
points[pointI]);
231 smoothVertex_.append(vType);
233 else if( vType == NONE )
235 smoothVertex_[nodeLabelForPoint[pointI]] = NONE;
257 nodeLabelForPoint[tVrt[0]],
258 nodeLabelForPoint[tVrt[1]],
259 nodeLabelForPoint[tVrt[2]],
260 nodeLabelForPoint[tVrt[3]]
267 nodeLabelForCell[cI] = points_.
size();
268 const label centreLabel = points_.size();
269 points_.append(cellCentres[cI]);
270 smoothVertex_.append(CELLCENTRE);
274 const face&
f = faces[
c[fI]];
276 if( owner[
c[fI]] == cI )
282 nodeLabelForPoint[
f[0]],
283 nodeLabelForPoint[
f[2]],
284 nodeLabelForPoint[
f[1]],
289 Info <<
"1.1 Tet " << tets_.size() <<
" is "
301 nodeLabelForPoint[
f[pI]],
302 nodeLabelForPoint[
f.prevLabel(pI)],
303 nodeLabelForFace[
c[fI]],
308 Info <<
"1.2 Tet " << tets_.size() <<
" is "
322 nodeLabelForPoint[
f[0]],
323 nodeLabelForPoint[
f[1]],
324 nodeLabelForPoint[
f[2]],
329 Info <<
"2.1 Tet " << tets_.size() <<
" is "
341 nodeLabelForPoint[
f[pI]],
342 nodeLabelForPoint[
f.nextLabel(pI)],
343 nodeLabelForFace[
c[fI]],
348 Info <<
"2.2 Tet " << tets_.size() <<
" is "
360 nodeLabelInOrigMesh_.setSize(points_.size());
361 nodeLabelInOrigMesh_ = -1;
362 forAll(nodeLabelForPoint, pI)
363 if( nodeLabelForPoint[pI] != -1 )
366 if( lockedPoints[pI] )
367 smoothVertex_[nodeLabelForPoint[pI]] |= LOCKED;
369 nodeLabelInOrigMesh_[nodeLabelForPoint[pI]] = pI;
374 pointTets_.reverseAddressing(points_.size(), tets_);
379 createParallelAddressing
386 createBufferLayers();
390 forAll(nodeLabelInOrigMesh_, pI)
392 (nodeLabelInOrigMesh_[pI] != -1) &&
393 (
mag(points_[pI] -
points[nodeLabelInOrigMesh_[pI]]) > SMALL)
397 "void partTetMesh::createPointsAndTets"
398 "(const boolList& useCell)"
408 internalPointsOrder.
setSize(0);
425 if( order[nodeI] != -1 )
434 for(
label i=0;i<4;++i)
446 forAll(neiCentrePoints, ncI)
448 const label centreI = neiCentrePoints[ncI];
454 for(
label i=0;i<4;++i)
461 selectedPoints.
append(nodeI);
462 order[nodeI] = internalPointsOrder.
size();
464 forAll(neiSmoothPoints, i)
465 helper[neiSmoothPoints[i]] =
true;
469 if( selectedPoints.
size() != 0 )
471 internalPointsOrder.
appendList(selectedPoints);
483 boundaryPointsOrder.
setSize(0);
500 if( order[nodeI] != -1 )
509 for(
label i=0;i<4;++i)
521 forAll(neiCentrePoints, ncI)
523 const label centreI = neiCentrePoints[ncI];
529 for(
label i=0;i<4;++i)
536 selectedPoints.
append(nodeI);
537 order[nodeI] = boundaryPointsOrder.
size();
539 forAll(neiSmoothPoints, i)
540 helper[neiSmoothPoints[i]] =
true;
544 if( selectedPoints.
size() != 0 )
546 boundaryPointsOrder.
appendList(selectedPoints);