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, access via your institution.







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
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
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
Bendsøe MP, Sigmund O (1995) Optimization of structural topology, shape, and material, vol 414. Springer, Berlin
Bendsoe MP, Sigmund O (2003) Topology optimization: theory, methods, and applications, 2nd edn. Springer, Berlin
Bendsoe MP, Sigmund O (2013) Topology optimization: theory, methods, and applications. Springer, Berlin
Bisong E (2019) Google colaboratory. Apress, Berkeley, pp 59–64
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
Chandrasekhar A, Kumar T, Suresh K (2020) Build optimization of fiber-reinforced additively manufactured components. Struct Multidiscip Optim 61(1):77–90
Chung H, Hwang JT, Gray JS, Kim HA (2019) Topology optimization in openmdao. Struct Multidiscip Optim 59(4):1385–1400
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
Deng S, Suresh K (2017) Topology optimization under thermo-elastic buckling. Struct Multidiscip Optim 55(5):1759–1772
Dilgen CB, Dilgen SB, Fuhrman DR, Sigmund O, Lazarov BS (2018) Topology optimization of turbulent flows. Comput Methods Appl Mech Eng 331:363–393
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
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
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
Gauger NR, Sagebaum M, Albring T (2019) High-performance derivative computations using codipack. ACM Trans Math Softw (TOMS) 45(4):1–26
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
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
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
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
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
Hascoet L, Pascual V (2013) The tapenade automatic differentiation tool: principles, model, and specification. ACM Trans Math Softw (TOMS) 39(3):1–43
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
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
Li Q, Chen W, Liu S, Tong L (2016) Structural topology optimization considering connectivity constraint. Struct Multidiscip Optim 54(4):971–984
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
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
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
Mirzendehdel AM, Suresh K (2015) A pareto-optimal approach to multimaterial topology optimization. J Mech Des 137(10):101701
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
Nørgaard SA, Sagebaum M, Gauger NR, Lazarov BS (2017) Applications of automatic differentiation in topology optimization. Struct Multidiscip Optim 56(5):1135–1146
Ozaki I, Kimura F, Berz M (1995) Higher-order sensitivity analysis of finite element method by automatic differentiation. Comput Mech 16(4):223–234
Paganini A, Wechsung F (2021) Fireshape: a shape optimization toolbox for firedrake. Struct Multidiscip Optim 63(5):2553–2569
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
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
Rumelhart DE, Hinton GE, Williams RJ (1986) Learning representations by back-propagating errors. Nature 323(6088):533–536
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
Saxena A, Ananthasuresh GK (2000) On an optimal property of compliant topologies. Struct Multidiscip Optim 19(1):36–49
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
Sigmund O (2001) A 99 line topology optimization code written in matlab. Struct Multidiscip Optim 21(2):120–127
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
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
Svanberg K (1987) The method of moving asymptotes-a new method for structural optimization. Int J Numer Methods Eng 24(2):359–373
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
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
Wang F, Sigmund O, Jensen JS (2014) Design of materials with prescribed nonlinear properties. J Mech Phys Solids 69:156–174
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
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
Acknowledgements
The authors would like to thank the support of National Science Foundation through grant CMMI 1561899.
Author information
Authors and Affiliations
Corresponding author
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
About this article
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
Received:
Revised:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s00158-021-03025-8