Presentation is loading. Please wait.

Presentation is loading. Please wait.

Mesh Generation, Refinement and Partitioning Algorithms Xin Sui The University of Texas at Austin.

Similar presentations


Presentation on theme: "Mesh Generation, Refinement and Partitioning Algorithms Xin Sui The University of Texas at Austin."— Presentation transcript:

1 Mesh Generation, Refinement and Partitioning Algorithms Xin Sui The University of Texas at Austin

2 Detailed classification

3 Delaunay Triangulation

4 Introduction The Problem – Given a set of points – Output a triangulation of the set of points that satisfies the Delaunay Property (introduced soon) Applications – Finite element analysis, computer graphics rendering, geometric modeling, etc Delaunay Triangulation Figure from Jernej Barbic’s slides Figure from Benoît Hudson’s slides(2007)

5 Delaunay Property No vertex is inside the circumcircle of any triangle (vertices are permitted on the circle) Maximize the minimum angle of all the angles of the triangles in the triangulation Delaunay triangulation is unique if no four points share the same circumcircle 5Delaunay Triangulation Figure from Jonathan Shewchuk’s PhD thesis

6 Triangulate the following points 6 Grey nodes are currently not in the mesh Delaunay Triangulation

7 Initialize a huge surrounding triangle 7 Grey nodes are currently not in the mesh Delaunay Triangulation

8 Insert one point and split the triangle the point falls in 8 Grey nodes are currently not in the mesh Delaunay Triangulation

9 Insert another point and split the triangle the point falls in 9 Grey node is currently not in the mesh Delaunay Triangulation

10 Check Delaunay Property (1) 10 Check if the new triangle’s circumcenter contains any other point Grey node is currently not in the mesh Delaunay Triangulation

11 Check Delaunay Property (2) 11 Grey node is currently not in the mesh Delaunay Triangulation

12 Insert another point and split the triangle the point falls in 12Delaunay Triangulation

13 Delaunay Property is not satisfied 13Delaunay Triangulation

14 Flip edge 14Delaunay Triangulation

15 Check the Delaunay Property (1) 15Delaunay Triangulation

16 Check the Delaunay Property (2) 16Delaunay Triangulation Newly created triangles may not satisfy the Delaunay property, so we may need to flip more edges.

17 Pseudocode of DT 1: Mesh m = /* initialize with one surrounding triangle */ 2: Set points = /* read points to insert */ 3: Worklist wl; 4: wl.add(points); 5: foreach Point p in wl { 6: Triangle t = m.surrounding(p); 7: Triangle newSplit[3] = m.splitTriangle(t, p); 8: Worklist wl2; 9: wl2.add(edges(newSplit)); 10: for Edge e in wl2 { 11: if (!isDelaunay(e)) { 12: Triangle newFlipped[2] = m.flipEdge(e); 13: wl2.add(edges(newFlipped)) 14: } } } 17Delaunay Triangulation

18 Amorphous Data-Parallelism Topology: graph Operator: morph (refinement) Active nodes: all the triangles containing points waiting for insertion Ordering: unordered Neighborhoods: The neighbor triangles of the split triangle and any triangles affected by edge flipping Parallelism: increasing from none to a lot Delaunay Triangulation18

19 ParaMeter Profile of DT Input: 10,000 random points

20 Delaunay Mesh Refinement

21 Introduction Applying Delaunay Triangulation to Lake Boundary Points 21Delaunay Mesh Refinement Figure from Jernej Barbic’s slides

22 Introduction The result is 22Delaunay Mesh Refinement Figure from Jernej Barbic’s slides

23 Introduction The result is A lot of skinny triangles ! 23Delaunay Mesh Refinement Figure from Jernej Barbic’s slides

24 Introduction The result is How to avoid skinny triangles? 24Delaunay Mesh Refinement Figure from Jernej Barbic’s slides

25 Delaunay Mesh Refinement Eliminate bad triangles that do not satisfy quality criteria – Skinny triangles: triangle has a circumradius-to- shortest edge ratio larger than some appropriate bound The idea is adding the circumcenter of bad triangles into the mesh as additional mesh points 25Delaunay Mesh Refinement

26 Pick one bad triangle 26Delaunay Mesh Refinement

27 Insert the circumcenter of the bad triangle 27Delaunay Mesh Refinement

28 Build the cavity Search all the triangles whose circumcircles contain the added node and those triangles form a subgraph called Cavity 28Delaunay Mesh Refinement

29 Re-triangulate the cavity Delete the triangles in the cavity Form new triangles from the added node with the boundary of the cavity May generate new bad triangles 29Delaunay Mesh Refinement

30 Pseudocode of DMR 1: Mesh m = /* read input mesh */ 2: Worklist wl = new Worklist(m.getBad()); 3: foreach Triangle t in wl { 4: Cavity c = new Cavity(t); 5: c.build(); 6: c.retriangulate(); 7: m.updateMesh(c); 8: wl.add(c.getBad()); 9: } 30Delaunay Mesh Refinement

31 Amorphous Data-Parallelism Topology: graph Operator: morph (refinement) Active nodes: all the bad triangles Ordering: unordered Neighborhoods: cavities Parallelism: lots 31Delaunay Mesh Refinement

32 ParaMeter Profile of DMR Input: 100,000 triangles, of which 47,000 are initially bad

33 Metis Graph Partitioning

34 Introduction Metis (George Karypis, UMN) – Partitioning the nodes of a graph into k roughly equal parts, such that the number of edges connecting nodes in different parts is minimized – Multilevel scheme Coarsening the graph into a very small graph Partitioning the small graph Projecting back the partitioning to original graph 34Metis Graph Partitioning

35 Introduction Metis (George Karypis, UMN) – Partitioning the nodes of a graph into k roughly equal parts, such that the number of edges connecting nodes in different parts is minimized – Multilevel scheme Coarsening the graph into a very small graph Partitioning the small graph Projecting back the partitioning to original graph Our focus 35Metis Graph Partitioning

36 Coarsening one level Match each node with one of its unmatched neighbor nodes Create a coarser graph 36Metis Graph Partitioning

37 Pseudocode of Coarsening 1: Graph g=/*input graph*/ 2: Do { 3: Graph cg=new Graph(); 4: g.matchNodes(); 5: cg.buildGraph(g); 6: g=cg; 7: } while (!g. coarseEnough()) 37Metis Graph Partitioning

38 How to match nodes? Maximal matching problem – NP-Complete – many heuristics Random Matching Heuristic – The nodes in the graph are visited in random order – If a node u has not been matched yet, then randomly select one of its unmatched neighbor nodes – If there is no unmatched neighbor node, the node u matches to itself 38Metis Graph Partitioning

39 Visit a Node 39Metis Graph Partitioning

40 Match to a Neighbor Node 40Metis Graph Partitioning

41 Visit another node 41Metis Graph Partitioning

42 Adjacent node Has Been Matched 42Metis Graph Partitioning

43 Find an Unmatched Neighbor Node 43Metis Graph Partitioning

44 Possible Final Matching 44Metis Graph Partitioning

45 Pseudocode of Graph.matchNodes() // Random Matching Heuristics 1: foreach Node n in graph{ 2: if n.isMatched() continue; 3: Node match = n; 4: for Node neighbor in n.getNeighbors(){ 5: if(!neighbor.isMatched()){ 6: match =neighbor; 7: break; 8: } 9: } 10: setMatch(n, match); 11: } } 45Metis Graph Partitioning

46 Creating Nodes in Coarse Graph Create a node r in the coarse graph to represent the matched nodes u, v in the fine graph. Node r is called representative of u, v 1 2 2 1 2 1 2 2 1 2 Fine Graph: the weight of each node is 1 Coarse Graph Pointer to the Representative 46Metis Graph Partitioning

47 Create Edges in the Coarse Graph a c b d e f g ab c’ d’ e’ f’ g’ 1 1 2 Fine Graph Coarse Graph

48 Pseudocode of Graph.buildGraph(Graph fineGraph) 1. Create Nodes in Coarse Graph 1: foreach Node n in fineGraph { 2: if(n.isprocessed()) continue; 3: Node cn = createNode(); //create Node for cg 4: n.setRepresentative(cn); 5: Node match=n.getMatch(); 6: match.setRepresentative(cn); 7: match.setProcessed(true); 8: } 48Metis Graph Partitioning

49 Pseudocode of Graph.buildGraph(Graph finer) 49Metis Graph Partitioning 2. Create Edges for Coarse Graph 1: foreach Node n in finer { 2: if(n.isProcessed()) continue; 3: Node m=n.getMatch(); 4: Node r=n.getRepresentative(); 5: createEdges(r, n, m, finer); 6: if(n!=m){ 7: createEdges(r, m, n, finer) 8: m.setProcessed(true); 9: } 10:} //BuildEdges For Node r in the CoarseGraph Graph.createEdges (Node r, Node n, Node match, Graph finer){ 11:for Node neigh in finer.getNeighbors(n) { 12: if(neigh==match) continue; 13: Node nr=neigh.getRepresentative(); 14: Edge e=finer.getEdge(n, neigh); 15: Edge ce=getEdge(r, nr); //create edge or adjust edge weight 16: if(ce==null) 17: createEdge(r, nr, e.weight); 18: else 19: e.increaseWeight(e.weight); 20: } 21: }

50 Amorphous Data-Parallelism(1) Match nodes in the fine graph – Topology: graph – Operator: local computation (structure-driven) – Active nodes: all the nodes in the graph – Ordering: unordered – Neighborhoods: active nodes’ neighbor nodes – Parallelism: lots Metis Graph Partitioning50

51 ParaMeter Profile of Matching Nodes 51Metis Graph Partitioning Input: graph with 60005 nodes and 89440 edges

52 Amorphous Data-Parallelism(2) Create nodes in the coarse graph – Topology: graph – Operator: morph (coarsening) – Active nodes: all the nodes in the fine graph – Ordering: unordered – Neighborhoods: active node’s matched node in fine graph and the representative nodes of the active node and its matched nodes in the coarse graph – Parallelism: lots 52Metis Graph Partitioning

53 Amorphous Data-Parallelism(3) Create edges in the coarse graph – Topology: graph – Operator: morph (coarsening) – Active nodes: all the nodes in the fine graph – Ordering: unordered – Neighborhoods: active node u’s neighbor nodes in fine graph and u’s representative node’s neighbor nodes in the coarse graph – Parallelism: lots 53Metis Graph Partitioning

54 ParaMeter Profile of Creating Edges in the Coarse Graph 54Metis Graph Partitioning Input: Fine graph: 60,005 nodes and 89,440 edges (Coarse graph: 34474 nodes and 63902 edges)

55 Thank you!


Download ppt "Mesh Generation, Refinement and Partitioning Algorithms Xin Sui The University of Texas at Austin."

Similar presentations


Ads by Google