TopOpt is a topology optimization package written in Julia. To learn more and see some examples, visit the documentation (dev) and the tutorials (dev). Numerous examples can also be found in the test/examples and test/wcsmo14 directories.
To install TopOpt.jl, run:
using Pkg
pkg"add TopOpt"To additionally load the visualization submodule of TopOpt, you will need to install GLMakie.jl using:
pkg"add Makie, GLMakie"To load the package, use:
using TopOptand to optionally load the visualization sub-module as part of TopOpt, use:
using TopOpt, Makie, GLMakie- 2D and 3D truss domains
- 2D and 3D continuum domains
- Unstructured ground mesh
- Linear and quadratic triangle, quadrilateral, tetrahedron and hexahedron elements in ground mesh
- Fixed and non-design domain support
- Concentrated and distributed loads
- Multi-material design parameterisation
The following high level topology optimization algorithms and penalty types are available.
- Solid isotropic material with penalization (SIMP)
- Rational approximation of material properties (RAMP)
- Continuation SIMP/RAMP
- Bi-directional evolutionary structural optimization (BESO) with soft-kill
- Topology optimization of binary structures (TOBS)
There are numerous functions in TopOpt.jl that are defined in a differentiable way and you can use them in the objectives or constraints in topology optimization formulations. In TopOpt.jl, you can build arbitrarily complex objective and constraint functions using these differentiable functions as building blocks or lego pieces chaining them in any arbitrary way. The gradient and jacobian of the aggregate Julia function defined is then obtained using automatic differentiation. For a detailed account of the functions available, see the relevant section in the documentation (dev).
- Direct sparse Cholesky decomposition based linear system solver
- Preconditioned conjugate gradient method with matrix assembly
- Matrix-free preconditioned conjugate gradient method
We use Nonconvex.jl for the optimization problem definition and solving. The following algorithms are all available using Nonconvex.jl.
- Method of moving asymptotes
- All the algorithms in NLopt
- Ipopt
- First order augmented Lagrangian algorithm
- Nonlinear semidefinite programming for buckling constrained optimization
- Basic surrogate assisted optimization and Bayesian optimization
- Integer nonlinear programming (design variables guaranteed to be integer)
- Sequential integer linear programming in the topology optimization for binary structures (TOBS) algorithm
- Handling load uncertainty in compliance-based topology optimization
- Reliability-based topology optimization
- End-to-end topology optimization from INP file to VTK file
- Interactive visualization of designs and deformation using Makie.jl
- Interactive visualization of designs using Dash apps and DashVtk
The tutorials (dev) cover a wide range of topics with complete, commented examples:
- SIMP — basic compliance minimization
- BESO / GESO — evolutionary optimization methods
- CSIMP — continuation SIMP
- TOBS — topology optimization for binary structures
- Global / local stress constraints — stress-constrained design
- Heat sink / heat tree — heat conduction problems
- Truss — truss topology optimization
- Buckling — buckling-constrained optimization
- Multi-material — multi-material design parameterisation
- Neural network — neural-network-based parameterization
- Mixed-integer truss — discrete truss design
See the full list and run the notebooks at TopOpt Tutorials (dev).
If you use TopOpt.jl in your research, please cite the following journal paper and conference publications.
@article{TarekRay2020,
title={Adaptive continuation solid isotropic material with penalization for volume constrained compliance minimization},
author={Tarek, Mohamed and Ray, Tapabrata},
journal={Computer Methods in Applied Mechanics and Engineering},
volume={363},
pages={112880},
year={2020},
doi={10/gg55cc}
}- TopOpt.jl: An efficient and high-performance package for topology optimization of continuum structures in the Julia programming language
@inproceedings{tarek2019topoptjl,
title={TopOpt.jl: An efficient and high-performance package for topology optimization of continuum structures in the Julia programming language},
author={Tarek, Mohamed},
booktitle={Proceedings of the 13th World Congress of Structural and Multidisciplinary Optimization},
year={2019}
}@inproceedings{huang2021topoptjl,
title={TopOpt.jl: Truss and Continuum Topology Optimization, Interactive Visualization, Automatic Differentiation and More},
author={Huang, Yijiang and Tarek, Mohamed},
booktitle={Proceedings of the 14th World Congress of Structural and Multidisciplinary Optimization},
year={2021}
}A standard citation file is provided as CITATION.bib.
We always welcome new contributors! Feel free to open an issue or reach out to us via email if you want to collaborate. There are plenty of things to do including beginner friendly tasks and research-oriented tasks. You can help us create the best topology optimization ecosystem in the world! Some beginner-friendly ideas you could be working on include:
- Level set design parameterization
- Lattice design parameterization
- Local volume constraints
- Supporting rectilinear grids
- Wrapping OpenLSTO_jll which is the precompiled binary for M2DOLab/OpenLSTO
- Wrapping TopOpt_in_PETSc_jll which is the precompiled binary for topopt/TopOpt_in_PETSc
- Robust optimization
- Stochastic optimization
If you have any questions, join us on on the #topopt channel in the Julia slack, open an issue or shoot us an email.




