Structural and Multidisciplinary Optimization

, Volume 45, Issue 3, pp 309–328 | Cite as

PolyMesher: a general-purpose mesh generator for polygonal elements written in Matlab

  • Cameron Talischi
  • Glaucio H. PaulinoEmail author
  • Anderson Pereira
  • Ivan F. M. Menezes
Educational Article


We present a simple and robust Matlab code for polygonal mesh generation that relies on an implicit description of the domain geometry. The mesh generator can provide, among other things, the input needed for finite element and optimization codes that use linear convex polygons. In topology optimization, polygonal discretizations have been shown not to be susceptible to numerical instabilities such as checkerboard patterns in contrast to lower order triangular and quadrilaterial meshes. Also, the use of polygonal elements makes possible meshing of complicated geometries with a self-contained Matlab code. The main ingredients of the present mesh generator are the implicit description of the domain and the centroidal Voronoi diagrams used for its discretization. The signed distance function provides all the essential information about the domain geometry and offers great flexibility to construct a large class of domains via algebraic expressions. Examples are provided to illustrate the capabilities of the code, which is compact and has fewer than 135 lines.


Topology optimization Polygonal elements Centroidal Voronoi tessellations Implicit geometries 



The first and second authors acknowledge the support by the Department of Energy Computational Science Graduate Fellowship Program of the Office of Science and National Nuclear Security Administration in the Department of Energy under contract DE-FG02-97ER25308. The third and last authors acknowledge the financial support by Tecgraf (Group of Technology in Computer Graphics), PUC-Rio, Rio de Janeiro, Brazil. The authors also acknowledge the insightful comments of the two anonymous reviewers which contributed to improving the manuscript further.

Supplementary material (8 kb)
(ZIP 11.6 KB)


  1. Allaire G, Jouve F (2005) A level-set method for vibration and multiple loads structural optimization. Comput Methods Appl Mech Eng 194(30–33):3269–3290. doi: 10.1016/j.cma.2004.12.018 MathSciNetzbMATHCrossRefGoogle Scholar
  2. Allaire G, Pantz O (2006) Structural optimization with FreeFem+ +. Struct Multidisc Optim 32(3):173–181. doi: 10.1007/s00158-006-0017-y MathSciNetCrossRefGoogle Scholar
  3. Andreassen E, Clausen A, Schevenels M, Lazarov B, Sigmund O (2011) Efficient topology optimization in MATLAB using 88 lines of code. Struct Multidisc Optim 43(1):1–16. doi: 10.1007/s00158-010-0594-7 Google Scholar
  4. Aurenhammer F (1991) Voronoi diagrams—a survey of a fundamental geometric data structure. ACM Comput Surv 23(3):345–405CrossRefGoogle Scholar
  5. Bolander JE, Saito S (1998) Fracture analyses using spring networks with random geometry. Eng Fract Mech 61(5–6):569–591. doi: 10.1016/S0013-7944(98)00069-1 CrossRefGoogle Scholar
  6. Challis VJ (2010) A discrete level-set topology optimization code written in matlab. Struct Multidisc Optim 41(3):453–464. doi: 10.1007/s00158-009-0430-0 MathSciNetCrossRefGoogle Scholar
  7. Cuthill E, McKee J (1969) Reducing the bandwidth of sparse symmetric matrices. In: Proceedings of the 24th national conference. ACM Press, New York, NY, pp 157–172. doi: 10.1145/800195.805928 CrossRefGoogle Scholar
  8. Du Q, Gunzburger M (2002) Grid generation and optimization based on centroidal Voronoi tessellations. Appl Math Comput 133(2–3):591–607. doi: 10.1016/S0096-3003(01)00260-0 MathSciNetzbMATHCrossRefGoogle Scholar
  9. Du Q, Wang DS (2005) The optimal centroidal Voronoi tessellations and the Gersho’s conjecture in the three-dimensional space. Comput Math Appl 49(9–10):1355–1373MathSciNetzbMATHCrossRefGoogle Scholar
  10. Du Q, Faber V, Gunzburger M (1999) Centroidal Voronoi tessellations: applications and algorithms. Siam Rev 41(4):637–676MathSciNetzbMATHCrossRefGoogle Scholar
  11. Du Q, Gunzburger M, Ju L (2003) Constrained centroidal Voronoi tessellations for surfaces. Siam J Sci Comput 24(5):1488–1506MathSciNetzbMATHCrossRefGoogle Scholar
  12. Du Q, Emelianenko M, Ju LL (2006) Convergence of the Lloyd algorithm for computing centroidal Voronoi tessellations. Siam J Numer Anal 44(1):102–119. doi: 10.1137/040617364 MathSciNetCrossRefGoogle Scholar
  13. Huang Y, Qin H, Wang D (2008) Centroidal Voronoi tessellation-based finite element superconvergence. Int J Numer Methods Eng 76(12):1819–1839. doi: 10.1002/nme.2374 MathSciNetzbMATHCrossRefGoogle Scholar
  14. Ju L, Gunzburger M, Zhao W (2006) Adaptive finite element methods for elliptic PDEs based on conforming centroidal Voronoi-Delaunay triangulations. Siam J Sci Comput 28(6):2023–2053MathSciNetzbMATHCrossRefGoogle Scholar
  15. Langelaar M (2007) The use of convex uniform honeycomb tessellations in structural topology optimization. In: 7th world congress on structural and multidisciplinary optimization, Seoul, South Korea, 21–25 May 2007Google Scholar
  16. Liu Y, Wang W, Levy B, Sun F, Yan D, Lu L, Yang C (2009) On centroidal Voronoi tesselleations–energy smoothness and fast computation. ACM Trans Graph 28(4):101:1–17Google Scholar
  17. Liu Z, Korvink JG, Huang R (2005) Structure topology optimization: fully coupled level set method via FEMLAB. Struct Multidisc Optim 29:407–417MathSciNetCrossRefGoogle Scholar
  18. Osher S, Fedkiw R (2003) Level set methods and dynamic implicit surfaces. Applied mathematical sciences, vol 153. Springer-Verlag, New YorkzbMATHGoogle Scholar
  19. Paulino GH, Menezes IFM, Gattass M, Mukherjee S (1994a) Node and element resequencing using the laplacian of a finite element graph: part I—general concepts and algorithm. Int J Numer Methods Eng 37(9):1511–1530. doi: 10.1002/nme.1620370907 zbMATHCrossRefGoogle Scholar
  20. Paulino GH, Menezes IFM, Gattass M, Mukherjee S (1994b) Node and element resequencing using the laplacian of a finite element graph: part II—implementation and numerical results. Int J Numer Methods Eng 37(9):1531–1555. doi: 10.1002/nme.1620370908 CrossRefGoogle Scholar
  21. Persson P (2006) Mesh size functions for implicit geometries and PDE-based gradient limiting. Eng Comput 22(2):95–109CrossRefGoogle Scholar
  22. Persson P, Strang G (2004) A simple mesh generator in MATLAB. Siam Rev 46(2):329–345MathSciNetzbMATHCrossRefGoogle Scholar
  23. Raghavan P, Li S, Ghosh S (2004) Two scale response and damage modeling of composite materials. Finite Elem Anal Des 40(12):1619–1640CrossRefGoogle Scholar
  24. Ricci A (1973) A constructive geometry for computer graphics. Comput J 16(2):157–160zbMATHCrossRefGoogle Scholar
  25. Saxena A (2008) A material-mask overlay strategy for continuum topology optimization of compliant mechanisms using honeycomb discretization. J Mech Des 130(8):082304. doi: 10.1115/1.2936891 CrossRefGoogle Scholar
  26. Sethian JA (1999) Fast marching methods. Siam Rev 41(2):199–235MathSciNetzbMATHCrossRefGoogle Scholar
  27. Sieger D, Alliez P, Botsch M (2010) Optimizing Voronoi diagrams for polygonal finite element computations. In: Proceedings of the 19th international meshing roundtableGoogle Scholar
  28. Sigmund O (2001) A 99 line topology optimization code written in Matlab. Struct Multidisc Optim 21(2):120–127CrossRefGoogle Scholar
  29. Sukumar N, Malsch EA (2006) Recent advances in the construction of polygonal finite element interpolants. Arch Comput Methods Eng 13(1):129–163MathSciNetzbMATHCrossRefGoogle Scholar
  30. Sukumar N, Tabarraei A (2004) Conforming polygonal finite elements. Int J Numer Methods Eng 61(12):2045–2066. doi: 10.1002/nme.1141 MathSciNetzbMATHCrossRefGoogle Scholar
  31. Suresh K (2010) A 199-line matlab code for Pareto-optimal tracing in topology optimization. Struct Multidisc Optim 42(5):665–679. doi: 10.1007/s00158-010-0534-6 MathSciNetCrossRefGoogle Scholar
  32. Sussman M, Fatemi E, Smereka P, Osher S (1998) An improved level set method for incompressible two-phase flows. Comput Fluids 27(5–6):663–680zbMATHCrossRefGoogle Scholar
  33. Talischi C, Paulino GH, Le CH (2009) Honeycomb Wachspress finite elements for structural topology optimization. Struct Multidisc Optim 37(6):569–583. doi: 10.1007/s00158-008-0261-4 MathSciNetCrossRefGoogle Scholar
  34. Talischi C, Paulino GH, Pereira A, Menezes IFM (2010) Polygonal finite elements for topology optimization: a unifying paradigm. Int J Numer Methods Eng 82(6):671–698. doi: 10.1002/nme.2763 zbMATHGoogle Scholar
  35. Talischi C, Paulino GH, Pereira A, Menezes IFM (2011) PolyTop: a Matlab implementation of a general topology optimization framework using unstructured polygonal finite element meshes. doi: 10.1007/s00158-011-0696-x
  36. Yip M, Mohle J, Bolander JE (2005) Automated modeling of three-dimensional structural components using irregular lattices. Comput-aided Civil Infrastruct Eng 20(6):393–407. doi: 10.1111/j.1467-8667.2005.00407.x CrossRefGoogle Scholar
  37. Zhao H (2004) A fast sweeping method for Eikonal equations. Math Comput 74(250):603–627CrossRefGoogle Scholar

Copyright information

© Springer-Verlag 2011

Authors and Affiliations

  • Cameron Talischi
    • 1
  • Glaucio H. Paulino
    • 1
    Email author
  • Anderson Pereira
    • 2
  • Ivan F. M. Menezes
    • 2
  1. 1.Department of Civil and Environmental EngineeringUniversity of Illinois at Urbana-ChampaignUrbanaUSA
  2. 2.TecgrafPontifical Catholic University of Rio de Janeiro (PUC-Rio)Rio de JaneiroBrazil

Personalised recommendations