Structural and Multidisciplinary Optimization

, Volume 41, Issue 3, pp 453–464 | Cite as

A discrete level-set topology optimization code written in Matlab

  • Vivien J. ChallisEmail author


This paper presents a compact Matlab implementation of the level-set method for topology optimization. The code can be used to minimize the compliance of a statically loaded structure. Simple code modifications to extend the code for different and multiple load cases are given. The code is inspired by a Matlab implementation of the solid isotropic material with penalization (SIMP) method for topology optimization (Sigmund, Struct Multidiscipl Optim 21:120–127, 2001). Including the finite element solver and comments, the code is 129 lines long. The code is intended for educational purposes, and in particular it could be used alongside the Matlab implementation of the SIMP method for topology optimization to demonstrate the similarities and differences between the two approaches.


Topology optimization Level-set method Matlab code Education 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Supplementary material

158_2009_430_MOESM1_ESM.m (0 kb)
VJC’s VERSION OF "bwdist" (1 KB)
158_2009_430_MOESM2_ESM.m (0 kb)
VJC’s VERSION OF "padarray" (1 KB)
158_2009_430_MOESM3_ESM.m (6 kb)


  1. Allaire G, Pantz O (2006) Structural optimization with FreeFem+ +. Struct Multidiscipl Optim 32:173–181CrossRefMathSciNetGoogle Scholar
  2. Allaire G, Jouve F, Toader A-M (2004) Structural optimization using sensitivity analysis and a level-set method. J Comput Phys 194:363–393zbMATHCrossRefMathSciNetGoogle Scholar
  3. Allaire G, de Gournay F, Jouve F, Toader A-M (2005) Structural optimization using topological and shape sensitivity via a level set method. Control Cybern 34(1):59–80zbMATHGoogle Scholar
  4. Bendsøe MP, Sigmund O (2004) Topology optimization: theory, methods and applications, 2nd edn. Springer, BerlinzbMATHGoogle Scholar
  5. Burger M, Hackl B, Ring W (2004) Incorporating topological derivatives into level set methods. J Comput Phys 194:344–362zbMATHCrossRefMathSciNetGoogle Scholar
  6. Challis VJ, Guest JK (2009) Level-set topology optimization of fluids in Stokes flow. Int J Numer Methods Eng 79:1284–1308zbMATHCrossRefMathSciNetGoogle Scholar
  7. Challis VJ, Roberts AP, Wilkins AH (2008a) Design of three dimensional isotropic microstructures for maximized stiffness and conductivity. Int J Solids Struct 45:4130–4146zbMATHCrossRefGoogle Scholar
  8. Challis VJ, Roberts AP, Wilkins AH (2008b) Fracture resistance via topology optimization. Struct Multidiscipl Optim 36:263–271CrossRefMathSciNetGoogle Scholar
  9. de Gournay F, Allaire G, Jouve F (2008) Shape and topology optimization of the robust compliance via the level set method. ESAIM COCV 14(1):43–70zbMATHCrossRefGoogle Scholar
  10. Luo J, Luo Z, Chen L, Tong L, Wang MY (2008a) A semi-implicit level set method for structural shape and topology optimization. J Comput Phys 227:5561–5581zbMATHCrossRefMathSciNetGoogle Scholar
  11. Luo J, Luo Z, Chen S, Tong L, Wang MY (2008b) A new level set method for systematic design of hinge-free compliant mechanisms. Comput Methods Appl Mech Eng 198:318–331Google Scholar
  12. Osher S, Fedkiw R (2002) Level set methods and dynamic implicit surfaces. Applied mathematical sciences, vol 153. Springer, New YorkGoogle Scholar
  13. Osher SJ, Santosa F (2001) Level set methods for optimization problems involving geometry and constraints I. Frequencies of a two-density inhomogeneous drum. J Comput Phys 171:272–288zbMATHCrossRefMathSciNetGoogle Scholar
  14. Osher SJ, Sethian JA (1988) Fronts propagating with curvature dependent speed: algorithms based on the Hamilton–Jacobi formulation. J Comput Phys 79:12–49zbMATHCrossRefMathSciNetGoogle Scholar
  15. Sethian JA (1999) Level set methods and fast marching methods: evolving interfaces in computational geometry, fluid mechanics, computer vision and materials science. Cambridge Monographs on Applied and Computational Mathematics, vol 3, 2nd edn. Cambridge University Press, CambridgeGoogle Scholar
  16. Sethian JA, Wiegmann A (2000) Structural boundary design via level set and immersed interface methods. J Comput Phys 163(2):489–528zbMATHCrossRefMathSciNetGoogle Scholar
  17. Sigmund O (2001) A 99 line topology optimization code written in Matlab. Struct Multidiscipl Optim 21:120–127CrossRefGoogle Scholar
  18. Wang MY, Wang X, Guo D (2003) A level set method for structural topology optimization. Comput Methods Appl Mech Eng 192:227–246zbMATHCrossRefMathSciNetGoogle Scholar

Copyright information

© Springer-Verlag 2009

Authors and Affiliations

  1. 1.Department of MathematicsThe University of QueenslandBrisbaneAustralia

Personalised recommendations