{"title":"Can ChatGPT Implement Finite Element Models for Geotechnical Engineering Applications?","authors":"Taegu Kim, Tae Sup Yun, Hyoung Suk Suh","doi":"10.1002/nag.3956","DOIUrl":null,"url":null,"abstract":"This study assesses the capability of ChatGPT to generate finite element code for geotechnical engineering applications from a set of prompts. We tested three different initial boundary value problems using a hydro‐mechanically coupled formulation for unsaturated soils, including the dissipation of excess pore water pressure through fluid mass diffusion in one‐dimensional space, time‐dependent differential settlement of a strip footing, and gravity‐driven seepage. For each case, initial prompting involved providing ChatGPT with necessary information for finite element implementation, such as balance and constitutive equations, problem geometry, initial and boundary conditions, material properties, and spatiotemporal discretization and solution strategies. Any errors and unexpected results were further addressed through prompt augmentation processes until the ChatGPT‐generated finite element code passed the verification/validation test. Our results demonstrate that ChatGPT required minimal code revisions when using the FEniCS finite element library, owing to its high‐level interfaces that enable efficient programming. In contrast, the MATLAB code generated by ChatGPT necessitated extensive prompt augmentations and/or direct human intervention, as it involves a significant amount of low‐level programming required for finite element analysis, such as constructing shape functions or assembling global matrices. Given that prompt engineering for this task requires an understanding of the mathematical formulation and numerical techniques, this study suggests that while a large language model may not yet replace human programmers, it can greatly assist in the implementation of numerical models.","PeriodicalId":13786,"journal":{"name":"International Journal for Numerical and Analytical Methods in Geomechanics","volume":"163 1","pages":""},"PeriodicalIF":3.4000,"publicationDate":"2025-02-06","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"International Journal for Numerical and Analytical Methods in Geomechanics","FirstCategoryId":"5","ListUrlMain":"https://doi.org/10.1002/nag.3956","RegionNum":2,"RegionCategory":"工程技术","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q2","JCRName":"ENGINEERING, GEOLOGICAL","Score":null,"Total":0}
引用次数: 0
Abstract
This study assesses the capability of ChatGPT to generate finite element code for geotechnical engineering applications from a set of prompts. We tested three different initial boundary value problems using a hydro‐mechanically coupled formulation for unsaturated soils, including the dissipation of excess pore water pressure through fluid mass diffusion in one‐dimensional space, time‐dependent differential settlement of a strip footing, and gravity‐driven seepage. For each case, initial prompting involved providing ChatGPT with necessary information for finite element implementation, such as balance and constitutive equations, problem geometry, initial and boundary conditions, material properties, and spatiotemporal discretization and solution strategies. Any errors and unexpected results were further addressed through prompt augmentation processes until the ChatGPT‐generated finite element code passed the verification/validation test. Our results demonstrate that ChatGPT required minimal code revisions when using the FEniCS finite element library, owing to its high‐level interfaces that enable efficient programming. In contrast, the MATLAB code generated by ChatGPT necessitated extensive prompt augmentations and/or direct human intervention, as it involves a significant amount of low‐level programming required for finite element analysis, such as constructing shape functions or assembling global matrices. Given that prompt engineering for this task requires an understanding of the mathematical formulation and numerical techniques, this study suggests that while a large language model may not yet replace human programmers, it can greatly assist in the implementation of numerical models.
期刊介绍:
The journal welcomes manuscripts that substantially contribute to the understanding of the complex mechanical behaviour of geomaterials (soils, rocks, concrete, ice, snow, and powders), through innovative experimental techniques, and/or through the development of novel numerical or hybrid experimental/numerical modelling concepts in geomechanics. Topics of interest include instabilities and localization, interface and surface phenomena, fracture and failure, multi-physics and other time-dependent phenomena, micromechanics and multi-scale methods, and inverse analysis and stochastic methods. Papers related to energy and environmental issues are particularly welcome. The illustration of the proposed methods and techniques to engineering problems is encouraged. However, manuscripts dealing with applications of existing methods, or proposing incremental improvements to existing methods – in particular marginal extensions of existing analytical solutions or numerical methods – will not be considered for review.