Skip to main content

A filter-based level set topology optimization method using a 62-line MATLAB code

Abstract

The present paper proposes a fast and easy to implement level set topology optimization method that is able to adjust the complexity of resulting configurations. While the existing methods solve a large system of linear equations, the proposed method applies a density filter to the level set function in order to smoothen the optimized configurations. Considering the proposed method, the minimum total potential energy problem and optimum design problem of compliant mechanism will be studied in the present study. In topology optimization methods, the topological derivative determines the criteria of removing/adding material from/to the domain of definition of the problem. We utilize the definition of topological derivative to measure the sensitivity of a given objective function when an infinite small hole is inserted at an arbitrary location of the domain. It is shown that a first-order stress field appears in the topological derivative. Moreover, a comprehensive Airy stress function is proposed in order to solve the boundary value problem that governs the appeared first-order stress field. Finally, a simple MATLAB implementation is provided to confirm the effectiveness and utility of the proposed method.

This is a preview of subscription content, access via your institution.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11
Fig. 12
Fig. 13
Fig. 14

References

  1. Allaire G (2012) A 2-d Scilab Code for shape and topology optimization by the level set method. http://www.cmap.polytechnique.fr/~allaire/levelset_en.html

  2. Allaire G, Jouve F, Toader AM (2002) A level-set method for shape optimization. C R Acad Sci Paris Ser I Math 334:1–6

    MathSciNet  MATH  Article  Google Scholar 

  3. Allaire G, Jouve F, Toader AM (2004) Structural optimization using sensitivity analysis and a level-set method. J Comput Phys 194:363–393

    MathSciNet  MATH  Article  Google Scholar 

  4. Allaire G, de Gournay F, Jouve F, Toader AM (2005) Structural optimization using topological and shape sensitivity via a level set method. Control Cybern 34:59–80

    MathSciNet  MATH  Google Scholar 

  5. Amstutz S, Andrä H (2006) A new algorithm for topology optimization using a level-set method. J Comput Phys 216(2):573–588

    MathSciNet  MATH  Article  Google Scholar 

  6. Andreassen E, Clausen A, Schevenels M, Lazarov BS, Sigmund O (2011) Efficient topology optimization in MATLAB using 88 lines of code. Struct Multidiscip Optim 43:1–16

    MATH  Article  Google Scholar 

  7. Bendsøe MP (1989) Optimal shape design as a material distribution problem. Struct Optim 1:193–202

    Article  Google Scholar 

  8. Bendsøe MP, Kikuchi N (1988) Generating optimal topologies in structural design using a homogenization method. Comput Methods Appl Mech Eng 71:197–224

    MathSciNet  MATH  Article  Google Scholar 

  9. Cea J, Garreau S, Guillaume P, Masmoudi M (2000) The shape and topological optimizations connection. Comput Methods Appl Mech Eng 188:713–726

    MathSciNet  MATH  Article  Google Scholar 

  10. Challis VJ (2010) A discrete level-set topology optimization code written in MATLAB. Struct Multidiscip Optim 41(3):453–464

    MathSciNet  MATH  Article  Google Scholar 

  11. Chen Q, Zhang X, Zhu B (2019) A 213-line topology optimization code for geometrically nonlinear structures. Struct Multidiscip Optim 59(5):1863–1879

    MathSciNet  Article  Google Scholar 

  12. Eschenauer HA, Kobelev HA, Schumacher A (1994) Bubble method for topology and shape optimization of structures. Struct Optim 8:142–151

    Article  Google Scholar 

  13. Feijoo RA, Novotny AA, Padra C, Taroco E (2004) The topological-shape sensitivity method and its application in 2D elasticity. To appear in journal of computational methods in sciences and engineering

  14. Guzina BB, Bonnet M (2004) Topological derivative for the inverse scattering of elastic waves. Q J Mech Appl Math 57(2):161–179

    MathSciNet  MATH  Article  Google Scholar 

  15. He L, Kao CY, Osher S (2007) Incorporating topological derivatives into shape derivatives based level set methods. J Comput Phys 225:891–909

    MathSciNet  MATH  Article  Google Scholar 

  16. Jia H, Beom HG, Wang Y, Lin S, Liu B (2011) Evolutionary level set method for structural topology optimization. Comput Struct 89:445–454

    Article  Google Scholar 

  17. Novotny AA, Sokołowski J (2012) Topological derivatives in shape optimization. Interaction of mechanics and mathematics. Springer, Heidelberg

    Google Scholar 

  18. Novotny AA, Feijoo RA, Taroco E, Padra C (2007) Topological sensitivity analysis for three-dimensional linear elasticity problem. Comput Methods Appl Mech Eng 196:4354–4364

    MathSciNet  MATH  Article  Google Scholar 

  19. Osher S, Fedkiw R (2003) Level set methods and dynamic implicit surfaces. Springer-Verlag, New York

    MATH  Book  Google Scholar 

  20. Osher S, Santosa F (2001) Level-set methods for optimization problems involving geometry and constraints: frequencies of a two density inhomogeneous drum. J Comput Phys 171:272–288

    MathSciNet  MATH  Article  Google Scholar 

  21. Osher S, Sethian JA (1988) Front propagating with curvature dependent speed: algorithms based on Hamilton–Jacobi formulations. J Comput Phys 78:12–49

    MathSciNet  MATH  Article  Google Scholar 

  22. Otomori M, Yamada T, Izui K, Nishiwaki S (2015) Matlab code for a level set-based topology optimization method using a reaction diffusion equation. Struct Multidiscip Optim 51:1159

    MathSciNet  Article  Google Scholar 

  23. Rao SS (2009) Engineering optimization theory and practice. John Wiley & Sons, Inc., Hoboken

    Book  Google Scholar 

  24. Selvadurai APS (2000) Partial differential equations in mechanics 2, the biharmonic equation, Poisson's equation. Springer-Verlag, Berlin

    MATH  Book  Google Scholar 

  25. 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, 2nd edn. Cambridge University Press, Cambridge

    MATH  Google Scholar 

  26. Sethian JA, Wiegmann A (2000) Structural boundary design via level set and immersed interface methods. J Comput Phys 163:489–528

    MathSciNet  MATH  Article  Google Scholar 

  27. Sigmund O (1997) On the design of compliant mechanisms using topology optimization. Mech Based Des Struct Mach 25:493–524

    Article  Google Scholar 

  28. Sigmund O (2007) Morphology-based black and white filters for topology optimization. Struct Multidiscip Optim 33(4–5):401–424

    Article  Google Scholar 

  29. Sokolowski J, Zochowski A (1999) On the topological derivative in shape optimization. SIAM J Control Optim 37:1251–1272

    MathSciNet  MATH  Article  Google Scholar 

  30. Wang SY, Wang MY (2006) Radial basis functions and level set method for structural topology optimization. Int J Numer Methods Eng 65:2060–2090

    MathSciNet  MATH  Article  Google Scholar 

  31. Wang MY, Zhou SW (2004) Phase field: a variational method for structural topology optimization. Comput Model Eng Sci 6(6):547–566

    MathSciNet  MATH  Google Scholar 

  32. Wang MY, Wang XM, Guo DM (2003) A level set method for structural topology optimization. Comput Methods Appl Mech Eng 192:227–246

    MathSciNet  MATH  Article  Google Scholar 

  33. Wang SY, Lim KM, Khoo BC, Wang MY (2007) An extended level set method for shape and topology optimization. J Comput Phys 221(1):395–421

    MathSciNet  MATH  Article  Google Scholar 

  34. Wei P, Li Z, Li X, Wang MY (2018) An 88-line MATLAB code for the parameterized level set method based topology optimization using radial basis functions. Struct Multidiscip Optim 58:831–849

    MathSciNet  Article  Google Scholar 

  35. Xia Q, Shi T, Xia L (2018) Stable hole nucleation in level set based topology optimization by using the material removal scheme of BESO. Comput Methods Appl Mech 34:438–452

    MATH  Google Scholar 

  36. Xie YM, Steven GP (1993) A simple evolutionary procedure for structural optimization. Comput Struct 49:885–896

    Article  Google Scholar 

  37. Yaghmaei M, Ghoddosian A (2019) A level set topology optimization method using a biharmonic equation based on plate theory. Struct Multidiscip Optim 60:2431–2459

  38. Yamada T, Izui K, Nishiwaki S, Takezawa A (2010) A topology optimization method based on the level set method incorporating a fictitious interface energy. Comput Methods Appl Mech Eng 199:2876–2891

    MathSciNet  MATH  Article  Google Scholar 

  39. Yang XY, Xie YM, Steven GP, Querin OM (1999) Bidirectional evolutionary method for stiffness optimization. AIAA J 37(11):1483–1488

    Article  Google Scholar 

Download references

Author information

Affiliations

Authors

Corresponding author

Correspondence to Ali Ghoddosian.

Ethics declarations

Conflict of interest

The authors declare that there is no conflict of interest.

Additional information

Publisher’s note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Responsible Editor: Emilio Carlos Nelli Silva

Appendix

Appendix

To derive an explicit expression for the second term in the right hand side of (22), we need to find the boundary value problem that governs δui over the ωϵ. Noting that (14) and (16) should be held for each , we can subtract (14) from (16) to obtain the following variation problem:

(50)

Integrating by part (that leads to Green’s formula), the right-hand side in the above equation can be replaced as follows:

(51)

where nk denotes the outward normal unit vector of the ball \( {\overline{B}}_{\epsilon } \) which is equal to minus of the outward normal unit vector of the inserted hole \( {\overline{n}}_k \). According to the (13), the second term on the right-hand side in (51) should be zero. Therefore, (50) takes the form of:

(52)

where \( {\overline{n}}_k\left(=-{n}_k\right) \) is the outward normal unit vector of the inserted hole. Equation (52) implies that δui should be governed by following strong form of boundary value problem:

$$ {\displaystyle \begin{array}{c}\mathit{\operatorname{div}}\ {C}_{ijkl}\ \delta {u}_{i,j}=0\kern0.75em on\kern0.75em {\omega}_{\epsilon}\\ {}{\delta t}_l=-{\sigma}_{kl}{\overline{n}}_k\kern0.5em on\ \partial {B}_{\epsilon}\end{array}} $$
(53)

Since the removed ball \( {\overline{B}}_{\epsilon } \) is infinite small comparing to the domain ωϵ, the above problem can be described as a plate infinite extent with a circular hole of radius ϵ, which is subjected to the traction \( -{\sigma}_{kl}{\overline{n}}_k \) on the boundary of the cavity. Using the polar coordinate system and Mohr’s circle (53) can be rewritten as:

$$ \left\{\begin{array}{c}{\delta \sigma}_{r r,r}+\frac{1}{r}{\delta \sigma}_{r\theta, \theta }+\frac{{\delta \sigma}_{r r}-{\delta \sigma}_{\theta \theta}}{r}=0\\ {}{\delta \sigma}_{r\theta, r}+\frac{1}{r}{\delta \sigma}_{\theta \theta, \theta }+\frac{2{\delta \sigma}_{r\theta}}{r}=0\end{array}\right.\kern1.5em on\kern0.5em \epsilon \le r<\infty and\ 0\le \theta <2\uppi $$
(54.a)
$$ \left\{\begin{array}{c}{\delta \sigma}_{r r}=-\left({\mathrm{S}}_1+{S}_2\cos 2\theta +{\sigma}_{12}\sin 2\theta \right)\\ {}{\delta \sigma}_{r\theta}=-\left({\sigma}_{12}\cos 2\theta -{S}_2\sin 2\theta \right)\end{array},\kern0.75em r=\epsilon \right. $$
(55.b)
$$ \left\{\begin{array}{c}\begin{array}{c}{\delta \sigma}_{r r}=0\\ {}{\delta \sigma}_{\theta \theta}=0\end{array}\\ {}{\delta \sigma}_{r\theta}=0\end{array}\right.,\kern0.5em r\to \infty $$
(55.c)

where

$$ {\mathrm{S}}_1=\frac{\sigma_{11}+{\sigma}_{22}}{2},\kern0.5em {\mathrm{S}}_1=\frac{\sigma_{11}-{\sigma}_{22}}{2} $$
(55)

The conventional approach for solving such a problem utilizes an appropriate guess for the Airy stress function φ, which satisfies the bi-harmonic equation ∇4φ = 0. The complete general solution of the Airy stress function φ(r, θ), corresponding to plane polar coordinates, is known (see, for instance, Selvadurai(2000)). The stress components in terms of the Airy stress function express as follows:

$$ {\displaystyle \begin{array}{c}{\delta \sigma}_{r r}=\frac{1}{r^2}{\varphi}_{,\theta \theta}+\frac{1}{r}{\varphi}_{,r}\\ {}{\delta \sigma}_{\theta \theta}={\varphi}_{, r r}\\ {}{\delta \sigma}_{r\theta}=\frac{1}{r^2}{\varphi}_{,\theta }-\frac{1}{r}{\varphi}_{, r\theta}\end{array}} $$
(56)

Noting the above relations, considering the expressions for the stresses on ∂Bϵ (see (55.b)) and boundedness of the stress field as r → ∞ (see (55.c)), we select φ(r, θ) to be of the form of:

$$ \varphi \left(r,\theta \right)=A\ln r+\left(\frac{B_1}{r^2}+{B}_2\right)\cos 2\theta +\left(\frac{C_1}{r^2}+{C}_2\right)\sin 2\theta $$
(57)

where A, B1, B2, C1, and C2 are constants. Substituting (57) into (56), we have:

$$ {\displaystyle \begin{array}{c}{\delta \sigma}_{r r}=\frac{A}{r^2}-\left(\frac{4{B}_2}{r^2}+\frac{6{B}_1}{r^4}\right)\cos 2\theta -\left(\frac{4{C}_2}{r^2}+\frac{6{C}_1}{r^4}\right)\sin 2\theta \\ {}{\delta \sigma}_{\theta \theta}=-\frac{A}{r^2}+\frac{6{B}_1}{r^4}\cos 2\theta +\frac{6{C}_1}{r^4}\sin 2\theta \\ {}{\delta \sigma}_{r\theta}=\left(\frac{2{C}_2}{r^2}+\frac{6{C}_1}{r^4}\right)\cos 2\theta -\left(\frac{2{B}_2}{r^2}+\frac{6{B}_1}{r^4}\right)\sin 2\theta \end{array}} $$
(58)

Using (55), all constants obtained as follows:

$$ A=-{\epsilon}^2{S}_1,\kern0.5em {B}_1=-\frac{1}{2}{S}_2{\epsilon}^4,\kern0.5em {B}_2={S}_2{\epsilon}^2,\kern0.5em {C}_1=-\frac{1}{2}{\sigma}_{12}{\epsilon}^4,\kern0.5em {C}_2={\sigma}_{12}{\epsilon}^2 $$
(59)

Therefore, the stress components are given as:

$$ {\displaystyle \begin{array}{c}{\delta \sigma}_{r r}=-{S}_1\frac{\epsilon^2}{r^2}-\left(4{S}_2\frac{\epsilon^2}{r^2}-3{S}_2\frac{\epsilon^4}{r^4}\right)\cos 2\theta -\left(4{\sigma}_{12}\frac{\epsilon^2}{r^2}-3{\sigma}_{12}\frac{\epsilon^4}{r^4}\right)\sin 2\theta \\ {}{\delta \sigma}_{\theta \theta}={S}_1\frac{\epsilon^2}{r^2}-3{S}_2\frac{\epsilon^4}{r^4}\cos 2\theta -3{\sigma}_{12}\frac{\epsilon^4}{r^4}\sin 2\theta \\ {}{\delta \sigma}_{r\theta}=\left(2{\sigma}_{12}\frac{\epsilon^2}{r^2}-3{\sigma}_{12}\frac{\epsilon^4}{r^4}\right)\cos 2\theta -\left(2{S}_2\frac{\epsilon^2}{r^2}-3{S}_2\frac{\epsilon^4}{r^4}\right)\sin 2\theta \end{array}} $$
(60)

Using the above stress field and taking into account that δε = c0(δσ), the second term in the right hand side of (22) is given as:

(61)

Considering the constitutive relation, (61) can be rewritten in terms of strain as follows:

$$ {\int}_{\omega_{\epsilon }}\left({\delta}^T\right){{\mathbf{c}}^0}^{-1}\left(\delta \right) d\varOmega =\left|{\overline{B}}_{\epsilon}\right|{\boldsymbol{\upvarepsilon}}^T{\mathbf{c}}^0{\mathbf{T}}^0{\mathbf{c}}^0\boldsymbol{\upvarepsilon} $$
(62)

Rights and permissions

Reprints and Permissions

About this article

Verify currency and authenticity via CrossMark

Cite this article

Yaghmaei, M., Ghoddosian, A. & Khatibi, M.M. A filter-based level set topology optimization method using a 62-line MATLAB code. Struct Multidisc Optim 62, 1001–1018 (2020). https://doi.org/10.1007/s00158-020-02540-4

Download citation

Keywords

  • Topology optimization
  • Level set method
  • Topological derivative
  • Airy stress function
  • Filtering regularization method
  • MATLAB code