| 712 | |
| 713 | |
| 714 | void Foam::polyDualMesh::calcDual |
| 715 | ( |
| 716 | const polyMesh& mesh, |
| 717 | const labelList& featureEdges, |
| 718 | const labelList& featurePoints |
| 719 | ) |
| 720 | { |
| 721 | const polyBoundaryMesh& patches = mesh.boundaryMesh(); |
| 722 | const label nIntFaces = mesh.nInternalFaces(); |
| 723 | |
| 724 | |
| 725 | // Get patch for all of outside |
| 726 | primitivePatch allBoundary |
| 727 | ( |
| 728 | SubList<face> |
| 729 | ( |
| 730 | mesh.faces(), |
| 731 | mesh.nFaces() - nIntFaces, |
| 732 | nIntFaces |
| 733 | ), |
| 734 | mesh.points() |
| 735 | ); |
| 736 | |
| 737 | // Correspondence from patch edge to mesh edge. |
| 738 | labelList meshEdges |
| 739 | ( |
| 740 | allBoundary.meshEdges |
| 741 | ( |
| 742 | mesh.edges(), |
| 743 | mesh.pointEdges() |
| 744 | ) |
| 745 | ); |
| 746 | |
| 747 | { |
| 748 | pointSet nonManifoldPoints |
| 749 | ( |
| 750 | mesh, |
| 751 | "nonManifoldPoints", |
| 752 | meshEdges.size() / 100 |
| 753 | ); |
| 754 | |
| 755 | allBoundary.checkPointManifold(true, &nonManifoldPoints); |
| 756 | |
| 757 | if (nonManifoldPoints.size()) |
| 758 | { |
| 759 | nonManifoldPoints.write(); |
| 760 | |
| 761 | FatalErrorInFunction |
| 762 | << "There are " << nonManifoldPoints.size() << " points where" |
| 763 | << " the outside of the mesh is non-manifold." << nl |
| 764 | << "Such a mesh cannot be converted to a dual." << nl |
| 765 | << "Writing points at non-manifold sites to pointSet " |
| 766 | << nonManifoldPoints.name() |
| 767 | << exit(FatalError); |
| 768 | } |
| 769 | } |
| 770 | |
| 771 |
no test coverage detected