35 template<
class Triangulation>
59 forAll(ownerNeighbourPair, oNI)
61 ownerNeighbourPair[oNI] =
labelPair(owner[oNI], neighbour[oNI]);
65 <<
"Sorting faces, owner and neighbour into upper triangular order"
72 oldToNew =
invert(oldToNew.size(), oldToNew);
80 template<
class Triangulation>
83 const label nInternalFaces,
88 const List<DynamicList<label> >& patchOwners
99 label nBoundaryFaces = 0;
104 patchDicts[
p].set(
"startFace", nInternalFaces + nBoundaryFaces);
109 faces.setSize(nInternalFaces + nBoundaryFaces);
110 owner.setSize(nInternalFaces + nBoundaryFaces);
112 label faceI = nInternalFaces;
119 owner[faceI] = patchOwners[
p][
f];
129 template<
class Triangulation>
132 PrintTable<word, label> triInfoTable(
"Mesh Statistics");
134 triInfoTable.add(
"Points", Triangulation::number_of_vertices());
135 triInfoTable.add(
"Edges", Triangulation::number_of_finite_edges());
136 triInfoTable.add(
"Faces", Triangulation::number_of_finite_facets());
137 triInfoTable.add(
"Cells", Triangulation::number_of_finite_cells());
139 scalar minSize = GREAT;
144 Finite_vertices_iterator vit = Triangulation::finite_vertices_begin();
145 vit != Triangulation::finite_vertices_end();
150 if (vit->internalOrBoundaryPoint())
152 minSize =
min(vit->targetCellSize(), minSize);
153 maxSize =
max(vit->targetCellSize(), maxSize);
160 Info<<
"Size (Min/Max) = "
168 template<
class Triangulation>
172 label nInternalRef = 0;
173 label nUnassigned = 0;
174 label nUnassignedRef = 0;
175 label nInternalNearBoundary = 0;
176 label nInternalNearBoundaryRef = 0;
177 label nInternalSurface = 0;
178 label nInternalSurfaceRef = 0;
179 label nInternalFeatureEdge = 0;
180 label nInternalFeatureEdgeRef = 0;
181 label nInternalFeaturePoint = 0;
182 label nInternalFeaturePointRef = 0;
183 label nExternalSurface = 0;
184 label nExternalSurfaceRef = 0;
185 label nExternalFeatureEdge = 0;
186 label nExternalFeatureEdgeRef = 0;
187 label nExternalFeaturePoint = 0;
188 label nExternalFeaturePointRef = 0;
194 Finite_vertices_iterator vit = Triangulation::finite_vertices_begin();
195 vit != Triangulation::finite_vertices_end();
199 if (vit->type() == Vb::vtInternal)
209 else if (vit->type() == Vb::vtUnassigned)
219 else if (vit->type() == Vb::vtInternalNearBoundary)
224 nInternalNearBoundaryRef++;
227 nInternalNearBoundary++;
229 else if (vit->type() == Vb::vtInternalSurface)
234 nInternalSurfaceRef++;
239 else if (vit->type() == Vb::vtInternalFeatureEdge)
244 nInternalFeatureEdgeRef++;
247 nInternalFeatureEdge++;
249 else if (vit->type() == Vb::vtInternalFeaturePoint)
254 nInternalFeaturePointRef++;
257 nInternalFeaturePoint++;
259 else if (vit->type() == Vb::vtExternalSurface)
264 nExternalSurfaceRef++;
269 else if (vit->type() == Vb::vtExternalFeatureEdge)
274 nExternalFeatureEdgeRef++;
277 nExternalFeatureEdge++;
279 else if (vit->type() == Vb::vtExternalFeaturePoint)
284 nExternalFeaturePointRef++;
287 nExternalFeaturePoint++;
289 else if (vit->type() == Vb::vtFar)
295 label nTotalVertices =
298 + nInternalNearBoundary
300 + nInternalFeatureEdge
301 + nInternalFeaturePoint
303 + nExternalFeatureEdge
304 + nExternalFeaturePoint
307 if (nTotalVertices !=
label(Triangulation::number_of_vertices()))
310 << nTotalVertices <<
" does not equal "
311 << Triangulation::number_of_vertices()
315 PrintTable<word, label> vertexTable(
"Vertex Type Information");
317 vertexTable.add(
"Total", nTotalVertices);
318 vertexTable.add(
"Unassigned", nUnassigned);
319 vertexTable.add(
"nInternal", nInternal);
320 vertexTable.add(
"nInternalNearBoundary", nInternalNearBoundary);
321 vertexTable.add(
"nInternalSurface", nInternalSurface);
322 vertexTable.add(
"nInternalFeatureEdge", nInternalFeatureEdge);
323 vertexTable.add(
"nInternalFeaturePoint", nInternalFeaturePoint);
324 vertexTable.add(
"nExternalSurface", nExternalSurface);
325 vertexTable.add(
"nExternalFeatureEdge", nExternalFeatureEdge);
326 vertexTable.add(
"nExternalFeaturePoint", nExternalFeaturePoint);
327 vertexTable.add(
"nFar", nFar);
328 vertexTable.add(
"nReferred", nReferred);
331 vertexTable.
print(os);
335 template<
class Triangulation>
339 const fileName&
name,
340 labelTolabelPairHashTable& vertexMap,
342 const bool writeDelaunayData
346 faceList faces(Triangulation::number_of_finite_facets());
347 labelList owner(Triangulation::number_of_finite_facets());
348 labelList neighbour(Triangulation::number_of_finite_facets());
359 vertexMap.resize(vertexCount());
360 cellMap.setSize(Triangulation::number_of_finite_cells(), -1);
390 Triangulation::number_of_vertices()
404 Triangulation::number_of_vertices()
409 Finite_vertices_iterator vit = Triangulation::finite_vertices_begin();
410 vit != Triangulation::finite_vertices_end();
414 if (!vit->farPoint())
416 vertexMap(
labelPair(vit->index(), vit->procIndex())) = vertI;
419 types[vertI] =
static_cast<label>(vit->type());
420 processorIndices[vertI] = vit->procIndex();
427 types.setSize(vertI);
428 processorIndices.setSize(vertI);
436 Finite_cells_iterator cit = Triangulation::finite_cells_begin();
437 cit != Triangulation::finite_cells_end();
444 && !Triangulation::is_infinite(cit)
448 cellMap[cit->cellIndex()] = cellI++;
454 face newFace(verticesOnTriFace);
458 Finite_facets_iterator fit = Triangulation::finite_facets_begin();
459 fit != Triangulation::finite_facets_end();
463 const Cell_handle
c1(fit->first);
464 const label oppositeVertex = fit->second;
465 const Cell_handle
c2(
c1->neighbor(oppositeVertex));
477 label c1I = Cb::ctFar;
481 !Triangulation::is_infinite(
c1)
482 && !
c1->hasFarPoint()
486 c1I = cellMap[
c1->cellIndex()];
490 label c2I = Cb::ctFar;
494 !Triangulation::is_infinite(
c2)
495 && !
c2->hasFarPoint()
499 c2I = cellMap[
c2->cellIndex()];
503 if (!c1Real && !c2Real)
509 label ownerCell = -1;
510 label neighbourCell = -1;
512 for (
label i = 0; i < 3; i++)
514 verticesOnTriFace[i] = vertexMap
520 Triangulation::vertex_triple_index(oppositeVertex, i)
524 Triangulation::vertex_triple_index(oppositeVertex, i)
530 newFace = face(verticesOnTriFace);
532 if (!c1Real || !c2Real)
549 patchOwners[0].append(ownerCell);
569 faces[faceI] = newFace;
570 owner[faceI] = ownerCell;
571 neighbour[faceI] = neighbourCell;
576 faces.setSize(faceI);
577 owner.setSize(faceI);
578 neighbour.setSize(faceI);
580 sortFaces(faces, owner, neighbour);
619 label nValidPatches = 0;
635 patches.setSize(nValidPatches);
639 if (writeDelaunayData)
643 processorIndices.write();