Skip to main content
Log in

AuTO: a framework for Automatic differentiation in Topology Optimization

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

Abstract

A critical step in topology optimization (TO) is finding sensitivities. Manual derivation and implementation of sensitivities can be quite laborious and error-prone, especially for non-trivial objectives, constraints and material models. An alternate approach is to utilize automatic differentiation (AD). While AD has been around for decades, and has also been applied in TO, its wider adoption has largely been absent. In this educational paper, we aim to reintroduce AD for TO, making it easily accessible through illustrative codes. In particular, we employ JAX, a high-performance Python library for automatically computing sensitivities from a user-defined TO problem. The resulting framework, referred to here as AuTO, is illustrated through several examples in compliance minimization, compliant mechanism design and microstructural design.

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.

Institutional subscriptions

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7

References

  • Agrawal A, Amos B, Barratt S, Boyd S, Diamond S, Kolter Z (2019) Differentiable convex optimization layers. arXiv preprint arXiv:1910.12430

  • Alexandersen J, Andreasen CS (2020) A review of topology optimisation for fluid-based problems. Fluids 5(1):29

    Article  Google Scholar 

  • Andersen MS, Dahl J, Vandenberghe L (2013) Cvxopt: a python package for convex optimization. abel. ee. ucla. edu/cvxopt

  • Barmada S, Fontana N, Formisano A, Thomopulos D, Tucci M (2021) A deep learning surrogate model for topology optimization. IEEE Trans Magn 57(6):1–4

    Article  Google Scholar 

  • Bathe K-J (2006) In: Bathe J-J (ed) Finite element procedures

  • Baydin AG, Pearlmutter BA, Radul AA, Siskind JM (2017) Automatic differentiation in machine learning: a survey. J Mach Learn Res 18(1):5595–5637

    MathSciNet  MATH  Google Scholar 

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

    Book  MATH  Google Scholar 

  • Bendsoe MP, Sigmund O (2003) Topology optimization: theory, methods, and applications, 2nd edn. Springer, Berlin

    MATH  Google Scholar 

  • Bendsoe MP, Sigmund O (2013) Topology optimization: theory, methods, and applications. Springer, Berlin

    MATH  Google Scholar 

  • Bisong E (2019) Google colaboratory. Apress, Berkeley, pp 59–64

    Google Scholar 

  • Blondel M, Berthet Q, Cuturi M, Frostig R, Hoyer S, Llinares-López F, Pedregosa F, Vert J-P (2021) Efficient and modular implicit differentiation. arXiv preprint arXiv:2105.15183

  • Bradbury J, Frostig R, Hawkins P, Johnson MJ, Leary C, Maclaurin D, Necula G, Paszke A, VanderPlas J, Wanderman-Milne S, Zhang Q (2018) JAX: composable transformations of Python+NumPy programs

  • Chandrasekhar A, Suresh K (2021) Multi-material topology optimization using neural networks. Comput-Aided Des 136:103017

    Article  MathSciNet  Google Scholar 

  • Chandrasekhar A, Kumar T, Suresh K (2020) Build optimization of fiber-reinforced additively manufactured components. Struct Multidiscip Optim 61(1):77–90

    Article  Google Scholar 

  • Chung H, Hwang JT, Gray JS, Kim HA (2019) Topology optimization in openmdao. Struct Multidiscip Optim 59(4):1385–1400

    Article  MathSciNet  Google Scholar 

  • Clausen A, Wang F, Jensen JS, Sigmund O, Lewis JA (2015) Topology optimized architectures with programmable poisson’s ratio over large deformations. Adv Mater 27(37):5523–5527

    Article  Google Scholar 

  • Deng S, Suresh K (2017) Topology optimization under thermo-elastic buckling. Struct Multidiscip Optim 55(5):1759–1772

    Article  MathSciNet  Google Scholar 

  • Dilgen CB, Dilgen SB, Fuhrman DR, Sigmund O, Lazarov BS (2018) Topology optimization of turbulent flows. Comput Methods Appl Mech Eng 331:363–393

    Article  MathSciNet  MATH  Google Scholar 

  • Dilgen SB, Dilgen CB, Fuhrman DR, Sigmund O, Lazarov BS (2018) Density based topology optimization of turbulent flow heat transfer systems. Struct Multidiscip Optim 57(5):1905–1918

    Article  MathSciNet  MATH  Google Scholar 

  • Dzierżanowski G (2012) On the comparison of material interpolation schemes and optimal composite properties in plane shape optimization. Struct Multidiscip Optim 46(5):693–710

    Article  MathSciNet  MATH  Google Scholar 

  • Gangl P, Sturm K, Neunteufel M, Schöberl J (2020) Fully and semi-automated shape differentiation in ngsolve. Struct Multidiscip Optim 63(3):1579–1607

    Article  MathSciNet  Google Scholar 

  • Gauger NR, Sagebaum M, Albring T (2019) High-performance derivative computations using codipack. ACM Trans Math Softw (TOMS) 45(4):1–26

    Article  MathSciNet  MATH  Google Scholar 

  • Gray JS, Hwang JT, Martins JRRA, Moore KT, Naylor BA (2019) Openmdao: an open-source framework for multidisciplinary design, analysis, and optimization. Struct Multidiscip Optim 59(4):1075–1104

    Article  MathSciNet  Google Scholar 

  • Griewank A, Juedes D, Utke J (1996) Algorithm 755: Adol-c: a package for the automatic differentiation of algorithms written in c/c++. ACM Trans Math Softw (TOMS) 22(2):131–167

    Article  MATH  Google Scholar 

  • Griewank A, Walther A (2008) Evaluating derivatives: principles and techniques of algorithmic differentiation. SIAM

  • Guest JK (2009) Imposing maximum length scale in topology optimization. Struct Multidiscip Optim 37(5):463–473

    Article  MathSciNet  MATH  Google Scholar 

  • Guest JK, Prévost JH, Belytschko T (2004) Achieving minimum length scale in topology optimization using nodal design variables and projection functions. Int J Numer Methods Eng 61(2):238–254

    Article  MathSciNet  MATH  Google Scholar 

  • Harris CR, Jarrod Millman K, van der Walt SJ, Gommers R, Virtanen P, Cournapeau D, Wieser E, Taylor J, Berg S, Smith NJ, Kern R, Picus M, Hoyer S, van Kerkwijk MH, Brett M, Haldane A, del R’ıo JF, Wiebe M, Peterson P, G’erard-Marchant P, Sheppard K, Reddy T, Weckesser W, Abbasi H, Gohlke C, Oliphant TE (2020) Array programming with NumPy. Nature 585(7825):357–362

    Article  Google Scholar 

  • Hascoet L, Pascual V (2013) The tapenade automatic differentiation tool: principles, model, and specification. ACM Trans Math Softw (TOMS) 39(3):1–43

    Article  MathSciNet  MATH  Google Scholar 

  • Howell Larry L (2013) Compliant mechanisms. In: 21st century kinematics. Springer, Berlin, pp 189–216

  • Jun W, Aage N, Westermann R, Sigmund O (2018) Infill optimization for additive manufacturing—approaching bone-like porous structures. IEEE Trans Vis Comput Gr 24(2):1127–1140

    Article  Google Scholar 

  • Jun W, Clausen A, Sigmund O (2017) Minimum compliance topology optimization of shell-infill composites for additive manufacturing. Comput Methods Appl Mech Eng 326:358–375

    Article  MathSciNet  MATH  Google Scholar 

  • Li Q, Chen W, Liu S, Tong L (2016) Structural topology optimization considering connectivity constraint. Struct Multidiscip Optim 54(4):971–984

    Article  MathSciNet  Google Scholar 

  • Liu J, Gaynor AT, Chen S, Kang Z, Suresh K, Takezawa A, Li L, Kato J, Tang J, Wang CCL et al (2018) Current and future trends in topology optimization for additive manufacturing. Struct Multidiscip Optim 57(6):2457–2483

    Article  Google Scholar 

  • Meurer A, Smith CP, Paprocki M, Čertík O, Kirpichev SB, Rocklin M, Kumar AMT, Ivanov S, Moore JK, Singh S, Rathnayake T, Vig S, Granger BE, Muller RP, Bonazzi F, Gupta H, Vats S, Johansson F, Pedregosa F, Curry MJ, Terrel AR, Roučka Š, Saboo A, Fernando I, Kulal S, Cimrman R, Scopatz A (2017) Sympy: symbolic computing in python. PeerJ Comput Sci 3:e103

    Article  Google Scholar 

  • Minkov M, Williamson IAD, Andreani LC, Gerace D, Lou B, Song AY, Hughes TW, Fan S (2020) Inverse design of photonic crystals through automatic differentiation. ACS Photon 7(7):1729–1741

    Article  Google Scholar 

  • Mirzendehdel AM, Suresh K (2015) A pareto-optimal approach to multimaterial topology optimization. J Mech Des 137(10):101701

    Article  Google Scholar 

  • Nishiwaki S, Frecker MI, Min S, Kikuchi N (1998) Topology optimization of compliant mechanisms using the homogenization method. Int J Numer Methods Eng 42(3):535–559

    Article  MathSciNet  MATH  Google Scholar 

  • Nørgaard SA, Sagebaum M, Gauger NR, Lazarov BS (2017) Applications of automatic differentiation in topology optimization. Struct Multidiscip Optim 56(5):1135–1146

    Article  MathSciNet  Google Scholar 

  • Ozaki I, Kimura F, Berz M (1995) Higher-order sensitivity analysis of finite element method by automatic differentiation. Comput Mech 16(4):223–234

    Article  MATH  Google Scholar 

  • Paganini A, Wechsung F (2021) Fireshape: a shape optimization toolbox for firedrake. Struct Multidiscip Optim 63(5):2553–2569

    Article  MathSciNet  Google Scholar 

  • Paszke A, Gross S, Massa F, Lerer A, Bradbury J, Chanan G, Killeen T, Lin Z, Gimelshein N, Antiga L, Desmaison A, Kopf A, Yang E, DeVito Z, Raison M, Tejani A, Chilamkurthy S, Steiner B, Fang L, Bai J, Chintala S (2019) Pytorch: an imperative style, high-performance deep learning library. In: Advances in neural information processing systems. Curran Associates, Inc, vol 32, pp 8024–8035

  • Qian X (2017) Undercut and overhang angle control in topology optimization: a density gradient based integral approach. Int J Numer Methods Eng 111(3):247–272

    Article  MathSciNet  Google Scholar 

  • Rall Louis B (2006) Perspectives on automatic differentiation: past, present, and future? In: Automatic differentiation: applications, theory, and implementations. Springer, Berlin, pp 1–14

  • Rokicki J et al (2016) Adjoint lattice boltzmann for topology optimization on multi-gpu architecture. Comput Math Appl 71(3):833–848

    Article  MathSciNet  MATH  Google Scholar 

  • Rumelhart DE, Hinton GE, Williams RJ (1986) Learning representations by back-propagating errors. Nature 323(6088):533–536

    Article  MATH  Google Scholar 

  • Sanders ED, Aguiló MA, Paulino GH (2018) Multi-material continuum topology optimization with arbitrary volume and mass constraints. Comput Methods Appl Mech Eng 340:798–823

    Article  MathSciNet  MATH  Google Scholar 

  • Saxena A, Ananthasuresh GK (2000) On an optimal property of compliant topologies. Struct Multidiscip Optim 19(1):36–49

    Article  Google Scholar 

  • Schoenholz Samuel S, Cubuk Ekin D (2019) Jax md: end-to-end differentiable, hardware accelerated, molecular dynamics in pure python

  • Semmler J, Pflug L, Stingl M (2018) Material optimization in transverse electromagnetic scattering applications. SIAM J Sci Comput 40(1):B85–B109

    Article  MathSciNet  MATH  Google Scholar 

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

    Article  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 Optim 16(1):68–75

    Article  Google Scholar 

  • Siu KL, Pitrou A, Seibert S (2015) Numba: a llvm-based python jit compiler. In: Proceedings of the second workshop on the LLVM compiler infrastructure in HPC, pp 1–6

  • Stolpe M, Svanberg K (2001) An alternative interpolation scheme for minimum compliance topology optimization. Struct Multidiscip Optim 22(2):116–124

    Article  Google Scholar 

  • Svanberg K (1987) The method of moving asymptotes-a new method for structural optimization. Int J Numer Methods Eng 24(2):359–373

    Article  MathSciNet  MATH  Google Scholar 

  • Van Keulen F, Haftka RT, Kim NH (2005) Review of options for structural design sensitivity analysis. part 1: linear systems. Comput Methods Appl Mech Eng 194(30–33):3213–3243

    Article  MATH  Google Scholar 

  • Vatanabe SL, Lippi TN, de Lima CR, Paulino GH, Silva ECN (2016) Topology optimization with manufacturing constraints: a unified projection-based approach. Adv Eng Softw 100:97–112

    Article  Google Scholar 

  • Wang F, Sigmund O, Jensen JS (2014) Design of materials with prescribed nonlinear properties. J Mech Phys Solids 69:156–174

    Article  MathSciNet  Google Scholar 

  • Wolfram (2020) Research Inc. Mathematica, Version 12.2. Champaign, IL

  • Xia L, Breitkopf P (2015) Design of materials using topology optimization and energy-based homogenization approach in matlab. Struct Multidiscip Optim 52(6):1229–1241

    Article  MathSciNet  Google Scholar 

  • Zhu B, Zhang X, Zhang H, Liang J, Zang H, Li H, Wang R (2020) Design of compliant mechanisms using continuum topology optimization: a review. Mech Mach Theory 143:103622

    Article  Google Scholar 

Download references

Acknowledgements

The authors would like to thank the support of National Science Foundation through grant CMMI 1561899.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Krishnan Suresh.

Ethics declarations

Conflict of interest

The authors declare that they have no conflict of interest.

Replication of results

The Python code pertinent to this paper is available at https://github.com/UW-ERSL/AuTO.

Additional information

Responsible Editor: Hyunsun Alicia Kim

Publisher's Note

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

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Chandrasekhar, A., Sridhara, S. & Suresh, K. AuTO: a framework for Automatic differentiation in Topology Optimization. Struct Multidisc Optim 64, 4355–4365 (2021). https://doi.org/10.1007/s00158-021-03025-8

Download citation

  • Received:

  • Revised:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00158-021-03025-8

Keywords

Navigation