FreeFEM++ code for reaction-diffusion equation–based topology optimization: for high-resolution boundary representation using adaptive mesh refinement

Cheolwoong Kim, Mingook Jung, Takayuki Yamada, Shinji Nishiwaki, Jeonghoon Yoo

Research output: Contribution to journalArticle


In this article, we present a simple FreeFEM++ code to represent high-resolution boundaries of the optimal shape using reaction-diffusion equation–based topology optimization and adaptive mesh refinement. The design algorithm is divided into two parts to achieve a high quality of the boundary. In the first part, loop 1, the ordinary method for a reaction-diffusion equation–based topology optimization, is applied to obtain the optimal shape. In the second part, loop 2, a modified reaction-diffusion equation combined with a double well potential, is employed as an optimizer and the adaptive mesh refinement is used with a gradual decrease of the diffusion coefficient. Because the code is intended for educational purposes, this paper provides background knowledge for understanding of the finite element method and topology optimization. Various numerical examples are discussed to confirm the robustness of the proposed design algorithm. The corresponding code may be downloaded from the website

Original languageEnglish
JournalStructural and Multidisciplinary Optimization
Publication statusAccepted/In press - 2020 Jan 1


All Science Journal Classification (ASJC) codes

  • Software
  • Control and Systems Engineering
  • Computer Science Applications
  • Computer Graphics and Computer-Aided Design
  • Control and Optimization

Cite this