This repository contains code of the following paper:
Changyu Deng, Yizhou Wang, Can Qin, Yun Fu, and Wei Lu. "Self-Directed Online Machine Learning for Topology Optimization." Nature Communications 13.1 (2022) Website Download arXiv
Open an issue for this repository or send emails to dengcy@umich.edu. I will try to respond within a few hours. Pull requests are welcome.
There are 8 examples of 4 types in the paper, two compliance minimization problems (coarse mesh/fine mesh), two
fluid-structure optimization problems (coarse mesh/fine mesh), a heat transfer enhancement problem (heat)
and three truss optimization problems (truss). Their code is in their individual folders; they do not share files. Please refer to
the readme.md
file in their own folder for more specific info.
If you are not sure which example to start from, I recommend
-
Fluid problem, if you have a GPU. It needs Python, COMSOL and Matlab. It is simple to undertsand and computes fast when you have a GPU.
-
Compliance problem, if you do not have a GPU. It needs Python, COMSOL and Matlab. It costs least computation but does not leverage GPU, so it will be slower than fluid problems when you have a GPU.
-
Truss problem, if you only have Python installed and do not want to install Matlab or COMSOL. It only uses Python, yet requires a GPU ( you can easily change the code to run on CPU, but you will wait for too long). Also, it is a little harder to understand than compliance problems and fluid problems.
I do NOT recommend starting from the heat problem. It is not easy to understand and time-consuming to compute.
Following softwares are used by most examples:
- COMSOL Multiphysics 5.4
- Matlab 2019b
- Python 3.7
- PyTorch 1.2.0
Higher versions should work fine. Lower versions may be compatible. Refer to the folders for more details. Some different packages may be needed.
Please note that the reproducibility is not guranteed due to PyTorch platform (see its documentation), yet similar results are expected.
There are four repositories that store the code/data of this work.
Code only:
- Github repository (most recommended). It contains latest code and directions to latest data.
- Zenodo repository. It contains releases of code.
Code and data (including generated .mph files and optimization results):