2e5dbec641 | ||
---|---|---|
top_mma | ||
top_oc | ||
LICENSE | ||
README.md |
README.md
Topology-Optimization-in-Julia
Julia Codes for Structural Topology Optimization Design
Codes
An educational Julia code is given mainly based on a compact and efficient Matlab implementation top99neo of compliance topology optimization (TO) for 2D continua1, which is a v3.0 version of the celebrated top99 Matlab code developed by Sigmund2 and top88 by its heir3.
Assemble just one half of the sysmetric stiffness matrix, thus substantial speedups are acheived.
top_oc/
and top_mma/
contain corresponding files related to the TO with OC and MMA algorithms, respectively.
Running codes could be tried out as:
include("./top99neo_mma.jl")
setup = SetUp() # problem setup
mat = Mat() # material property
disfeature = DiscretizationFeature(setup, mat) # model discretization
load = LoadsSupportsBCs(setup, disfeature) # boudary conditions
ini = Initialization(setup, disfeature, mat) # initial conditions
filter = Filter(setup) # filtering
xPhys, opt_hist, vf_hist, anim = Optimization(setup, mat, load, filter, ini, disfeature) # optimization process
gif(anim, "./res/des_hist.gif", fps=20) # design result visulization
Results
A benchmark MBB example is presented. TO design results are saved in ./res/
folder and a evolution history is shown as below.
Packages
Run the Julia REPL, enter ]
to bring up Julia's package manager,
and add the listed packages:
julia> ]
(@v1.7) pkg> add #pkg_name#
- Scientific computing
- LinearAlgebra
- SparseArrays
- Statistics : mean
- Image process
- ImageFiltering: imfilter
- Modelling
- FEM
- AD
- Optimization
- Visualization
- Plots
TODOs
top99neo.jl
top99neo.m rewritten in JuliaMMA.jl
MMA algorithm (mmasub.m + subsolve.m) rewritten in Juliatop99neo_mma.jl
2D code (top99neo + MMA) written in Juliatop99neo_AD.jl
Sensitivity Analysis using Automatic Differentiationtop99neo_NLopt.jl
Optimization solved with NLopttop3D.jl
3D code (top3D125 + MMA) written in Juliatop_flux.jl
Combine TO with machine learning through Flux
Acknowledgements
-
TopOpt Group 🇩🇰 Matlab codes for topology optimization
- v1.0 top99.m Educatianal TO enlightenment for every beginners
- v2.0 top88.m Loop vectorization and memory preallocation
- v3.0 top99neo.m Half matrix assembly operation, filter implementation and volume-preserving density projection
-
Prof. Krister Svanberg 🇸🇪
- Freely available Matlab code for CCSA/MMA4 and GCMMA
Author ©️
📧 Please contact to liyu_npu@outlook.com
⚠️ Disclaimer: The author reserves all rights but does not guarantee that the code is free from errors. Furthermore, we shall not be liable in any event.
@misc{Yu2022,
author = {Yu Li},
title = {Topology Optimization in Julia},
year = {2022},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/yuloveyet/Topology-Optimization-in-Julia}},
}
References
-
Ferrari, F., & Sigmund, O. (2020). A new generation 99 line Matlab code for compliance topology optimization and its extension to 3D. Structural and Multidisciplinary Optimization, 62(4), 2211-2228. ↩︎
-
Sigmund, O. (2001). A 99 line topology optimization code written in Matlab. Structural and multidisciplinary optimization, 21(2), 120-127. ↩︎
-
Andreassen, E., Clausen, A., Schevenels, M., Lazarov, B. S., & Sigmund, O. (2011). Efficient topology optimization in MATLAB using 88 lines of code. Structural and Multidisciplinary Optimization, 43(1), 1-16. ↩︎
-
Svanberg, K. (2002). A class of globally convergent optimization methods based on conservative convex separable approximations. SIAM journal on optimization, 12(2), 555-573. ↩︎