Python serves as an open-source and cost-effective alternative to the MATLAB programming language. This paper introduces a concise topology optimization Python code, named ``\texttt{PyHexTop}," primarily intended for educational purposes. Code employs hexagonal elements to parameterize design domains as such elements provide checkerboard-free optimized design naturally. \texttt{PyHexTop} is developed based on the ``\texttt{HoneyTop90}" MATLAB code~\cite{kumar2023honeytop90} and uses the \texttt{NumPy} and \texttt{SciPy} libraries. Code is straightforward and easily comprehensible, proving a helpful tool that can help people new in the topology optimization field to learn and explore. \texttt{PyHexTop} is specifically tailored to address compliance minimization with specified volume constraints. The paper provides a detailed explanation of the code for solving the Messerschmitt-Bolkow-Blohm beam and extensions to solve problems different problems. The code is publicly shared at: \url{https://github.com/PrabhatIn/PyHexTop.}
翻译:Python作为一种开源且经济高效的编程语言,是MATLAB的替代选择。本文介绍了一种简洁的拓扑优化Python代码,命名为“\texttt{PyHexTop}”,主要面向教育用途。该代码采用六边形单元对设计域进行参数化,因为此类单元能自然避免棋盘格现象,获得无棋盘格的优化设计。\texttt{PyHexTop}基于“\texttt{HoneyTop90}”MATLAB代码~\cite{kumar2023honeytop90}开发,并使用了\texttt{NumPy}和\texttt{SciPy}库。该代码结构清晰、易于理解,是一个有助于拓扑优化领域初学者学习和探索的有效工具。\texttt{PyHexTop}专门用于解决指定体积约束下的柔度最小化问题。本文详细阐述了该代码在求解Messerschmitt-Bolkow-Blohm梁问题上的实现,并扩展至求解不同问题的应用。代码已公开共享于:\url{https://github.com/PrabhatIn/PyHexTop.}