Abstract
This paper presents a simple Matlab implementation for a level set-based topology optimization method in which the level set function is updated using a reaction diffusion equation, which is different from conventional level set-based approaches (Allaire et al. 2002, 2004; Wang et al. 2003) that use the Hamilton-Jacobi equation to update the level set function. With this method, the geometrical complexity of optimized configurations can be easily controlled by appropriately setting a regularization parameter. We explain the code in detail, and also the derivation of the topological derivative that is used in the level set-based topology optimization. Numerical results for stiffness maximization problems are provided to facilitate the reader’s understanding. The presented code is intended for educational purposes only. This paper was inspired by previously published papers presenting Matlab code for a SIMP method (Sigmund 2001; Andreassen et al. 2011), a level set-based method (Challis 2010), and FreeFem ++ code for a structural optimization method (Allaire and Pantz 2006). Readers can investigate results provided by these different methods and discover the prominent aspects of each particular method. The code presented here can be downloaded from http://www.osdel.me.kyoto-u.ac.jp/members/yamada/codes.html.
References
Allaire G (2002) Shape optimization by the homogenization method. Vol. 146 of applied mathematical sciences. Springer, New York
Allaire G, Pantz O (2006) Structural optimization with FreeFem++. Struct Multidiscipl Optim 32:173–181
Allaire G, Jouve F, Toader AM (2002) A level-set method for shape optimization. C R Acad Sci Paris Ser I 334:1125–1130
Allaire G, Jouve F, Toader AM (2004) Structural optimization using sensitivity analysis and a level-set method. J Comp Phys 194:363–393
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
Andreassen E, Clausen A, Schevenels M, Lazarov BS, Sigmund O (2011) Efficient topology optimization in MATLAB using 88 lines of code. Struct Multidiscipl Optim 43:1–16
Bendsøe MP, Kikuchi N (1988) Generating optimal topologies in structural design using a homogenization method. Comput Methods Appl Mech Eng 71:197–224
Bendsøe MP (1989) Optimal shape design as a material distribution problem. Struct Multidiscipl Optim 1:193–202
Challis VJ (2010) A discrete level-set topology optimization code written in Matlab. Struct Multidisc Optim 41:453–464
Eschenauer HA, Kobelev VV, Schumacher A (1994) Bubble method for topology and shape optimization of structures. Struct Multidisc Optim 8:42–51
Howell HH (2001) Compliant mechanisms. Wiley
Guzina BB, Bonnet M (2004) Topological derivative for the inverse scattering of elastic waves. Q J Mech Appl Math 57 (2):161–179
Lurie AI, Belyaev A (2005) Theory of elasticity. Springer, New York
Nishiwaki S, Frecker MI, Min S, Kikuchi N (1998) Topology optimization of compliant mechanisms using the homogenization method. Int J Numer Methods Eng 535–559
Osher SJ, Sethian JA (1988) Fronts propagating with curvature dependent speed: algorithms based on Hamilton-Jacobi formulations. J Comput Phys 79:12–49
Sigmund O (2001) A 99 line topology optimization code written in Matlab. Struct Multidisc Optim 21:120–127
Wang MY, Wang X, Guo D (2003) A level set method for structural topology optimization. Comput Methods Appl Mech Eng 192:227–246
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
Acknowledgments
The authors would like to express their gratitude to Prof. Toshiro Matsumoto and Prof. Hiroshi Isakari for their helpful discussions concerning topological derivatives and encouragement of this work.
Author information
Authors and Affiliations
Corresponding author
Appendices
Appendix A: Matlab code
Appendix B: Topological derivative derivation
The boundary value problem for a created hole can be described as
We note that the boundary conditions expressed in (39) and (40) indicate that the displacement and traction after creating a hole must satisfy the original displacement and traction constraints, respectively. (41) represents the free surface on the boundary of the created hole.
The Lagrangian that includes the created hole is given as
When the boundary condition (41) is inserted into (42), the third term on the right-hand side becomes zero. Subtracting the Lagrangian (19) from the Lagrangian (42), the variation \(\delta \bar {F}\) of the Lagrangian then becomes
The third term on the right-hand side in the above equation can be replaced using Green’s formula, as follows:
where \(\tilde t_{i}\) is the derivative of Lagrange multiplier \(\tilde u_{i}\) in the normal direction and n l is the normal vector at boundary Γ 𝜖 . Substituting the above equation into (43) and considering the conditions, δ u i =0 on Γ u and δ t i =0 on Γ t , the variation of the Lagrangian is then given as
The adjoint equation is now defined so that the integrals of the term that includes δ u i or δ t i are canceled out, as follows:
The variation of the Lagrangian can be obtained as follows, using the adjoint variable obtained by solving the above adjoint field.
The first term on the right-hand side of the above equation represents state variable u i and adjoint variable \(\tilde u_{i}\), which are known values. On the other hand, the value of δ u i in the second term is unknown. We note that this second term was ignored in previous research (Yamada et al. 2010), so that the method did not consider the effect of boundary condition Γ 𝜖 that arises when a hole is created in the design domain.
By subtracting the boundary value problem (15)–(17) from the boundary value problem (38)-(41), we obtain the following boundary value problem by which the unknown value δ u is governed.
In the above problem, since the radius of the hole 𝜖 is sufficiently small, the effect of boundaries Γ u and Γ t can be ignored for solving δ u i on Γ 𝜖 . δ u i is then a solution of the following boundary value problem.
where the superscript 0 indicates the value without creating holes, and σ i j =C i j k l u k,l . The solution of this boundary value problem in sphere Γ 𝜖 is given (Guzina and Bonnet 2004; Lurie and Belyaev 2005) as:
The variation of Lagrangian \(\bar {F}\) is then given by:
where δ i j is Kronecker’s delta function. Finally, the topological derivative of the Lagrangian is given as
where A i j k l is defined as follows:
Appendix C: Topological derivative implementation
First, for simplicity, we reformulate the tensor A i j k l defined in (22) as follows:
Namely,
The first term on the right-hand side in (21) can then be given as follows:
In the above formulation, we use \(u^{0}_{i,j}\) instead of u i,j for simplicity. Now, using the following definition of strains, 𝜖 i i = u i,i , and τ i j = u i,j +u j,i , the above equation is transformed as follows:
Similarly, for the plane stress problem, we have
where \(c = \frac {A_{1}}{A_{1}+2A_{2}}\). Compare this with the following formulation of the mutual strain energy density:
The topological derivative can be therefore computed by substituting A 1, A 2 into E, ν in the procedure for computing the mutual strain energy density, as follows:
Rights and permissions
About this article
Cite this article
Otomori, M., Yamada, T., Izui, K. et al. Matlab code for a level set-based topology optimization method using a reaction diffusion equation. Struct Multidisc Optim 51, 1159–1172 (2015). https://doi.org/10.1007/s00158-014-1190-z
Received:
Revised:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s00158-014-1190-z