Skip to main content
Log in

A FreeFEM code for topological derivative-based structural optimization

  • Educational Paper
  • Published:
Structural and Multidisciplinary Optimization Aims and scope Submit manuscript

Abstract

This article presents an educational code written in FreeFEM, based on the concept of topological derivative together with a level-set domain representation method and adaptive mesh refinement processes, to perform compliance minimization in structural optimization. The code is implemented in the framework of linearized elasticity, for both plane strain and plane stress assumptions. As a first-order topology optimization algorithm, the topological derivative is in fact used within the numerical procedure as a steepest descent direction, similar to methods based on the gradient of cost functionals. In addition, adaptive mesh refinement processes are used as part of the optimization scheme for enhancing the resolution of the final topology. Since the paper is intended for educational purposes, we start by explaining how to compute topological derivatives, followed by a step-by-step description of the code, which makes the binding of the theoretical aspects of the algorithm to its implementation. Numerical results associated with three classic examples in topology optimization are presented and discussed, showing the effectiveness and robustness of the proposed approach.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

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

References

  • Allaire G (2002) Shape optimization by the homogenization method. Applied mathematical sciences, vol 146. Springer, New York

  • Allaire G, Pantz O (2006) Structural optimization with FreeFEM++. Struct Multidisc Optim 32:173–181

    MathSciNet  MATH  Google Scholar 

  • Allaire G, Dapogny C, Jouve F (2021) Handbook of numerical analysis, geometric partial differential equations—Part 2, vol XXII, chap Shape and topology optimization. Elsevier, Amsterdam, pp 1–132

  • Amigo R, Giusti SM, Novotny AA, Silva EC, Sokołowski J (2016) Optimum design of flextensional piezoelectric actuators into two spatial dimensions. SIAM J Control Optim 52(2):760–789. https://doi.org/10.1137/151004860

  • Amstutz S (2011) Analysis of a level set method for topology optimization. Optim Methods Softw 26(4–5):555–573

    MathSciNet  MATH  Google Scholar 

  • 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  Google Scholar 

  • Amstutz S, Novotny A (2010) Topological optimization of structures subject to von Mises stress constraints. Struct Multidisc Optim 41(3):407–420

    MathSciNet  MATH  Google Scholar 

  • Amigo R, Giusti SM, Novotny AA, Silva EC, Sokołowski J (2010) Topological derivative for multi-scale linear elasticity models applied to the synthesis of microstructures. Int J Numer Methods Eng 84:733–756

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

    MATH  Google Scholar 

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

    Google Scholar 

  • Bendsøe MP (1995) Optimization of structural topology, shape, and material. Springer, Berlin

    MATH  Google Scholar 

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

    MathSciNet  MATH  Google Scholar 

  • Bendsøe MP, Sigmund O (2003) Topology optimization. Theory, methods and applications. Springer, Berlin

  • Calisti V, Lebée A, Novotny AA, Sokolowski J (2021) Sensitivity of the second order homogenized elasticity tensor to topological microstructural changes. J Elast 144:141–167. https://doi.org/10.1007/s10659-021-09836-6

    Article  MathSciNet  MATH  Google Scholar 

  • Challis VJ (2010) A discrete level-set topology optimization code written in Matlab. Struct Multidisc Optim 41:453–464

    MathSciNet  MATH  Google Scholar 

  • Duarte LS, Celes W, Pereira A, Menezes IFM, Paulino GH (2015) PolyTop++: an efficient alternative for serial and parallel topology optimization on CPUs & GPUs. Struct Multidisc Optim 52:845–859

    Google Scholar 

  • Fancello EA (2006) Topology optimization of minimum mass design considering local failure constraints and contact boundary conditions. Struct Multidisc Optim 32:229–240

    MathSciNet  MATH  Google Scholar 

  • Feppon F, Allaire G, Dapogny C, Jolivet P (2020) Topology optimization of thermal fluid-structure systems using body-fitted meshes and parallel computing. J Comput Phys 417(109):574

    MathSciNet  MATH  Google Scholar 

  • Gangl P, Langer U, Laurain A, Meftahi H, Sturm K (2015) Shape optimization of an electric motor subject to nonlinear magnetostatics. SIAM J Sci Comput 37(6):B1002–B1025

    MathSciNet  MATH  Google Scholar 

  • Giraldo-Londoño O, Paulino GH (2021) PolyDyna: a Matlab implementation for topology optimization of structures subjected to dynamic loads. Struct Multidisc Optim 64:957–990

    MathSciNet  Google Scholar 

  • Giraldo-Londoño O, Paulino GH (2021) PolyStress: a Matlab implementation for local stress-constrained topology optimization using the augmented lagrangian method. Struct Multidisc Optim 63:2065–2097

    MathSciNet  Google Scholar 

  • Giusti S, Mróz Z, Sokolowski J, Novotny A (2017) Topology design of thermomechanical actuators. Struct Multidisc Optim 55:1575–1587

    MathSciNet  Google Scholar 

  • Hecht F (2012) New development in freefem++. J Numer Math 20(3–4):251–265

    MathSciNet  MATH  Google Scholar 

  • Hecht F (2022) FreeFEM documentation https://doc.freefem.org/introduction/index.html#. Accessed Aug 2022

  • Jolivet P, Dolean V, Hecht F, Prud'Homme C, Spillance N (2012) High performance domain decomposition methods on massively parallel architectures with freefem++. J Numer Math 20(3–4):287–302

    MathSciNet  MATH  Google Scholar 

  • Kim C, Jung M, Yamada T, Nishiwaki S, Yoo J (2020) FreeFEM++ code for reaction-diffusion equation-based topology optimization: for high resolution boundary representation using adaptive mesh refinement. Struct Multidisc Optim 62:439–455

    MathSciNet  Google Scholar 

  • Laurain A (2018) A level set-based structural optimization code using FEniCS. Struct Multidisc Optim 58:1311–1334

    MathSciNet  Google Scholar 

  • Liu K, Tovar A (2014) An efficient 3D topology optimization code written in Matlab. Struct Multidisc Optim 50:1175–1196

    MathSciNet  Google Scholar 

  • Liu Z, Korvink JG, Huang R (2005) Structure topology optimization: fully coupled level set method via FEMLAB. Struct Multidisc Optim 29:407–417

    MathSciNet  MATH  Google Scholar 

  • Lopes C, Novotny A (2016) Topology design of compliant mechanisms with stress constraints based on the topological derivative concept. Struct Multidisc Optim 54(4):737–746

    MathSciNet  Google Scholar 

  • Lopes C, Santos R, Novotny A, Sokolowski J (2017) Asymptotic analysis of variational inequalities with applications to optimum design in elasticity. Asymptot Anal 102:227–242

    MathSciNet  MATH  Google Scholar 

  • Novotny A, Sokołowski J (2013) Topological derivatives in shape optimization. Interaction of mechanics and mathematics, Springer, Berlin. https://doi.org/10.1007/978-3-642-35245-4

    Article  MATH  Google Scholar 

  • Novotny A, Sokołowski J (2020) An introduction to the topological derivative method. Springer briefs in mathematics. Springer, Cham. https://doi.org/10.1007/978-3-030-36915-6

  • Novotny A, Feijóo R, Taroco E, Padra C (2007) Topological sensitivity analysis for three-dimensional linear elasticity problem. Comput Methods Appl Mech Eng 196(41–44):4354–4364

    MathSciNet  MATH  Google Scholar 

  • Novotny A, Sokołowski J, Żochowski A (2019) Applications of the topological derivative method. Studies in systems, decision and control. Springer, Cham. https://doi.org/10.1007/978-3-030-05432-8

  • Novotny A, Giusti S, Amstutz S (2022) Guest Editorial: on the topological derivative method and its applications in computational engineering. Eng Comput 39(1):1–2

    Google Scholar 

  • Oliver J, Yago D, Cante J, Lloberas-Valls O (2019) Variational approach to relaxed topological optimization: closed form solutions for structural problems in a sequential pseudo-time framework. Comput Methods Appl Mech Eng 355(1):779–819

    MathSciNet  MATH  Google Scholar 

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

    MathSciNet  MATH  Google Scholar 

  • 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 Multidisc Optim 51(5):1159–1172

    MathSciNet  Google Scholar 

  • Sá L, Amigo R, Novotny A, Silva ECN (2016) Topological derivatives applied to fluid flow channel design optimization problems. Struct Multidisc Optim 54(2):249–264

    MathSciNet  Google Scholar 

  • Sanders ED, Pereira A, Aguiló MA, Paulino GH (2018) PolyMat: an efficient Matlab code for multi-material topology optimization. Struct Multidisc Optim 58:2727–2759

    MathSciNet  Google Scholar 

  • Santos R, Lopes C, Novotny A (2017) Structural weight minimization under stress constraints and multiple loading. Mech Res Commun 81:44–50

    Google Scholar 

  • Sigmund O (2001) A 99 line topology optimization code written in Matlab. Struct Multidisc Optim 21:120–127

    Google Scholar 

  • Sigmund O, Petersson J (1998) Numerical instabilities in topology optimization: a survey on procedures dealing with checkerboards, mesh-dependencies and local minima. Struct Multidisc Optim 16:68–75

    Google Scholar 

  • Sokołowski J, Żochowski A (1999) On the topological derivative in shape optimization. SIAM J Control Optim 37(4):1251–1272

    MathSciNet  MATH  Google Scholar 

  • Sokołowski J, Zolésio JP (1992) Introduction to shape optimization–shape sensitivity analysis. Springer, Berlin

    MATH  Google Scholar 

  • Suresh K (2010) A 199-line Matlab code for Pareto-optimal tracing in topology optimization. Struct Multidisc Optim 42:665–679

    MathSciNet  MATH  Google Scholar 

  • Talischi C, Paulino GH, Pereira A, Menezes IFM (2012) PolyMesher: a general-purpose mesh generator for polygonal elements written in Matlab. Struct Multidisc Optim 45:309–328

    MathSciNet  MATH  Google Scholar 

  • Talischi C, Paulino GH, Pereira A, Menezes IFM (2012) PolyTop: a Matlab implementation of a general topology optimization framework using unstructured polygonal finite element meshes. Struct Multidisc Optim 45:329–357

    MathSciNet  MATH  Google Scholar 

  • Torii A, Novotny A, Santos R (2016) Robust compliance topology optimization based on the topological derivative concept. Int J Numer Methods Eng 106(11):889–903

    MathSciNet  MATH  Google Scholar 

  • van Dijk NP, Maute K, Langelaar M, van Keulen F (2013) Level-set methods for structural topology optimization: a review. Struct Multidisc Optim 48:437–472

    MathSciNet  Google Scholar 

  • Wang C, Zhao Z, Zhou M, Sigmund O, Zhang XS (2021) A comprehensive review of educational articles on structural and multidisciplinary optimization. Struct Multidisc Optim 64:2827–2880

    Google Scholar 

Download references

Acknowledgements

The authors would like to express deep gratitude to Professor Antonio André Novotny (LNCC) for his vision and technical guidance in this paper.

Funding

This research was partly supported by CNPq (Brazilian Research Council), CAPES (Brazilian Higher Education Staff Training Agency), and FAPESP (The São Paulo Research Foundation), grant 2021/049479-8. These financial supports are gratefully acknowledged.

Author information

Authors and Affiliations

Authors

Contributions

Jorge Morvan Marotte Luz Filho, Raquel Mattoso, and Lucas dos Santos Fernandez have contributed equally to this work.

Corresponding author

Correspondence to Lucas Fernandez.

Ethics declarations

Conflict of interest

The authors declare that they have no conflict of interest.

Replication of results

The source code is given in the Appendix. All the presented results are obtained by direct running of the code.

Additional information

Responsible Editor: Xiaojia Shelly Zhang

Publisher's Note

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

Supplementary Information

Below is the link to the electronic supplementary material.

Supplementary file1 (EDP 7 KB)

Appendix: Source code

Appendix: Source code

figure g
figure h

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Luz Filho, J.M.M., Mattoso, R. & Fernandez, L. A FreeFEM code for topological derivative-based structural optimization. Struct Multidisc Optim 66, 74 (2023). https://doi.org/10.1007/s00158-023-03529-5

Download citation

  • Received:

  • Revised:

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1007/s00158-023-03529-5

Keywords

Navigation