Supplementary codes and datasets for "Modular-topology optimization of structures and mechanisms with free material design and clustering"
收藏资源简介:
This repository supports manuscript “Modular-topology optimization of structures and mechanisms with free material design and clustering” by M. Tyburec, M. Doškář, J. Zeman, and M. Kružík, first published as preprint 2111.10439 at arXiv.org. This repository contains: MATLAB source codes for <em>(modular) free material optimisation</em> and <em>hierarchical stiffness clustering</em> (folder <code>./mFMO/</code>) C++ source codes for <em>modular topology optimization</em> (folder <code>./MTO/</code>) Input/output data of the test suite (folder <code>./data/</code>) <strong>1. Data flow</strong> The test suite considered in the manuscript covers 4 problems: Messerschmitt-Bölkow-Blohm beam (labelled as <code>mbb</code>) Inverter compliant mechanism (labelled as <code>inv</code>) Gripper compliant mechanism (labelled as <code>grip</code>) Reusable design of both compliant mechanisms (labelled as <code>invgrip</code>) Each problem in the dataset is stored within a separate subfolder named according to the labels mentioned above. The final level of subdirectories <code>{X}color</code> comprises of the results for problems with <code>X</code> denoting the number of edge codes considered for each edge direction during the clustering (<code>0color</code> stands for a non-modular design and <code>1color</code> represents the design based on Periodic Unit Cell). Each of the folders contains outputs of the modular free material optimisation in the following form: <code>{label}{X}.mat</code> <code>{label}{X}.til</code> <code>{label}{X}.tset</code> <code>{label}{X}guess.mat</code> Files <code>*.til</code>, <code>*.tset</code>, and <code>*guess.mat</code> are then converted into a JSON input file for the modular topology optimization code with generator scripts which can be found in <code>./MTO/scripts</code> folder. Note that each of the problems in the test suite has its own generator script <code>generate_modular_problem_{MBB,inverter,gripper,inverterAndGripper}.mat</code>. The generator scripts make a directory named according to the key <code>MTO_{n}_kernelSensitivity</code>, where <code>n</code> denotes the resolution of each module (i.e. the number of nodes along one direction). The directory also contains the outputs of the modular topology optimisation in the form of the initial and the final state of the optimization in <code>VTK</code> files and visualisation of the final state in <code>SVG</code> files. The log file <code>log.txt</code> stores the optimized objective and progress of the value along with stopping criteria quantities during iterations. <strong>2. Running codes</strong> <strong>2.1 Modular free material optimisation</strong> MATLAB scripts and functions for (modular) Free Material Optimization (FMO) are contained in the <code>mFMO</code> data folder. The codes have been tested with MATLAB R2019b. To run the codes the user is required to install the PENNON optimizer. A free academic license is provided by its authors on request. Input files for individual problems are defined in the <code>mFMO/problems</code> folder and are launched with the <code>runproblem(problemName, numClusters)</code>, where <code>problemName</code> refers to the file in the <code>mFMO/problems</code> folder without the file extension and <code>numClusters</code> denotes the maximum number of color codes in Wang tiling formalism. If successful, the optimization produces output files in <code>mFMO/fmo_fig/{label}/{X}colors/{T}/</code>: <code>{label}{X}.mat</code> (contains clustering and tiling information) <code>{label}{X}_tmp.mat</code> (contains results of non-modular FMO) <code>{label}{X}.til</code> (the assembly plan) <code>{label}{X}.tset</code> (Wang tile set) <code>{label}{X}guess.mat</code> (guess for TO) where <code>T</code> is the optimization time stamp. <strong>2.2 Modular topology optimisation</strong> All results were obtained with version <code>v0.1.0</code>, which is also provided in the folder <code>MTO</code>, and linked Intel® oneAPI Math Kernel Library and the incorporated PARDISO sparse solver. For the recent development of the code see the open git repository at https://gitlab.com/MartinDoskar/modular-topology-optimization. The repository also contains a detailed description of input parameters and code design. Modular topology optimisation code uses CMake for the cross-platform build automation. For instance, under Linux, the whole code can be compiled in the standard five steps: <pre><code>cd ./MTO mkdir build cd ./build cmake -DCMAKE_BUILD_TYPE=Release .. make </code></pre> All executables are automatically stored in <code>./MTO/bin/</code> folder. Individual problems can be optimized by parsing the JSON files obtained from the generator scripts as an argument to the MTO.Application binary, e.g., <pre><code>./MTO/bin/MTO.Application.exe path_to_data/mbb/2color/MTO_100_kernelSensitivity/input_modular_mbb_2colours_100.json </code></pre> <strong>Acknowledgement</strong> The related research and code development was supported by the Czech Science Foundation, project No. 19-26143X.
本仓库配套论文《考虑自由材料设计与聚类的结构与机构模块化拓扑优化》(Modular-topology optimization of structures and mechanisms with free material design and clustering),作者为M. Tyburec、M. Doškář、J. Zeman与M. Kružík,最早以预印本编号2111.10439发布于arXiv.org。本仓库包含以下内容: - 用于**(模块化)自由材料优化**(modular free material optimisation)与**层级刚度聚类**(hierarchical stiffness clustering)的MATLAB源代码(位于`./mFMO/`文件夹) - 用于**模块化拓扑优化**(modular topology optimization)的C++源代码(位于`./MTO/`文件夹) - 测试集的输入/输出数据(位于`./data/`文件夹) ### 1. 数据流 本文稿中的测试集涵盖4类问题: 1. 梅塞施密特-伯尔科-布洛姆梁(Messerschmitt-Bölkow-Blohm beam,标记为`mbb`) 2. 逆变器式柔顺机构(Inverter compliant mechanism,标记为`inv`) 3. 夹持器式柔顺机构(Gripper compliant mechanism,标记为`grip`) 4. 两类柔顺机构的复用设计(Reusable design of both compliant mechanisms,标记为`invgrip`) 数据集内的每一类问题均存储于以对应标记命名的独立子文件夹中。子目录的最终层级为`{X}color`,其中`X`代表聚类过程中每个边缘方向考虑的边缘编码数量,该文件夹包含对应配置下的优化结果;`0color`表示非模块化设计,`1color`代表基于周期性单胞(Periodic Unit Cell)的设计。 每个文件夹均包含以下形式的模块化自由材料优化输出文件: `{label}{X}.mat`、`{label}{X}.til`、`{label}{X}.tset`、`{label}{X}guess.mat` 随后,`*.til`、`*.tset`与`*guess.mat`文件将通过生成脚本转换为模块化拓扑优化代码的JSON输入文件,相关生成脚本位于`./MTO/scripts`文件夹中。需注意,测试集内的每一类问题均配有专属生成脚本:`generate_modular_problem_{MBB,inverter,gripper,inverterAndGripper}.mat`。 生成脚本会创建一个以`MTO_{n}_kernelSensitivity`命名的目录,其中`n`代表每个模块的分辨率(即单方向上的节点数)。该目录同时包含模块化拓扑优化的输出结果:优化初始与最终状态的VTK文件、最终状态的SVG可视化文件,以及记录优化过程中目标函数值、进度与迭代停止准则参数的日志文件`log.txt`。 ### 2. 代码运行 #### 2.1 模块化自由材料优化 用于(模块化)自由材料优化(Free Material Optimization, FMO)的MATLAB脚本与函数位于`mFMO`数据文件夹中。本代码已在MATLAB R2019b环境下完成测试。用户需安装PENNON优化器方可运行本代码,该工具可向作者申请免费的学术许可证。 各问题的输入文件定义于`mFMO/problems`文件夹中,可通过`runproblem(problemName, numClusters)`命令启动运行:其中`problemName`指代`mFMO/problems`文件夹内的输入文件(不含文件扩展名),`numClusters`代表Wang平铺(Wang tiling)形式下的最大颜色编码数。若优化成功,输出文件将保存至`mFMO/fmo_fig/{label}/{X}colors/{T}/`路径下,具体包括: - `{label}{X}.mat`:包含聚类与平铺信息 - `{label}{X}_tmp.mat`:包含非模块化FMO的优化结果 - `{label}{X}.til`:装配方案 - `{label}{X}.tset`:Wang平铺集 - `{label}{X}guess.mat`:拓扑优化初始猜测文件 其中`T`为优化时间戳。 #### 2.2 模块化拓扑优化 所有实验结果均通过`v0.1.0`版本代码获得,该版本亦存放于`MTO`文件夹中,且链接了Intel® oneAPI Math Kernel Library与内置的PARDISO稀疏求解器。如需了解代码的最新开发进展,请访问开源Git仓库:https://gitlab.com/MartinDoskar/modular-topology-optimization。该仓库同时包含输入参数与代码设计的详细说明。 模块化拓扑优化代码使用CMake进行跨平台构建自动化。以Linux系统为例,完整编译流程可通过以下标准五步完成: bash cd ./MTO mkdir build cd ./build cmake -DCMAKE_BUILD_TYPE=Release .. make 所有可执行文件将自动保存至`./MTO/bin/`文件夹中。可通过将生成脚本得到的JSON文件作为参数传递给`MTO.Application`二进制文件来优化各类问题,示例命令如下: bash ./MTO/bin/MTO.Application.exe path_to_data/mbb/2color/MTO_100_kernelSensitivity/input_modular_mbb_2colours_100.json ### 致谢 本相关研究与代码开发得到捷克科学基金会项目No. 19-26143X的资助。



