A MATLAB Implementation of ES-FEM-based Topology Optimization
본 논문은 에지 기반 평활화 유한요소법(Edge-based smoothed finite element method, ES-FEM)을 도입한 위상 최적화를 간결하고 효 율적인 MATLAB 코드로 구현하였다. 제안한 MATLAB 코드는 교육적 목적을 위해 내부 및 경계 에지를 중심으로 평활화 영역을 체 계적으로 생성하고, 해당 영역에 대한 평활화 강성 행렬을 계산함으로써 ES-FEM을 효과적으로 벡터화하는 방법을 보여준다. 특히 배열 사전 할당을 통해 계산 효율성을 한층 향상시켰다. 아울러, 개선된 밀도 필터를 도입하여 기존 ES-FEM 기반 위상 최적화 기법 보다 수식을 단순화하면서도 계산 성능을 크게 향상시켰다. 이러한 개선으로 전체 MATLAB 코드는 175줄로 구현되어 높은 가독성 과 사용 편의성을 갖춘다. 또한 경계 조건과 하중의 적용은 몇 줄만 수정하면 되어, 연구자가 손쉽게 코드를 유연하게 확장할 수 있 다. MATLAB 코드는 부록에 수록되어 있으며, 이를 통해 위상 최적화와 ES-FEM에 입문하는 연구자들이 보다 쉽게 학습할 수 있도 록 명확하고 직관적인 교육적 자료를 제공하고자 한다.
This paper presents a compact and efficient MATLAB implementation of topology optimization using the edge-based smoothed finite element method (ES-FEM). The framework is designed with pedagogical intent, illustrating how ES-FEM can be effectively vectorized through the systematic construction of smoothing domains around interior and boundary edges, followed by the computation of smoothed stiffness matrices over these domains. Computational efficiency is further enhanced through array preallocation. An improved density filter is incorporated, simplifying the formulation while delivering better performance compared to existing ES-FEM-based topology optimization approaches. With this enhancement, the complete implementation requires only 175 lines of MATLAB code, ensuring both readability and ease of use. Boundary conditions and loading can be customized by modifying only a few lines, making the approach flexible and easily extensible. The full MATLAB code is provided in the Appendix as an accessible starting point for newcomers to topology optimization and ES-FEM, offering a clear and approachable entry point with a gentle learning curve.