Assessing ChatGPT for coding finite element methods

Keywords

Code:
31/2023
Title:
Assessing ChatGPT for coding finite element methods
Date:
Wednesday 12th April 2023
Author(s):
Orlando, G.
Download link:
Abstract:
ChatGPT is a language model trained by OpenAI to follow an instruction in a prompt and to provide a detailed response. We investigate the capabilities of ChatGPT to generate codes which implement the finite element method. The Finite element method (FEM) is a popular technique for the numerical solution of partial differential equations (PDEs). More specifically, we analyze the codes generated for two open source platforms: deal.II, a C++ software library, and FEniCS, for which we focus on its Python interface. We consider as benchmark problems the Poisson equation and a linear advection problem. The outcomes suggest that ChatGPT can be employed as initial building block to write finite element codes, but certain limitations and failures, which require further improvement of the machine learning model and a human supervision, are still present.