Can ChatGPT implement finite element models for geotechnical engineering applications?
Preprint
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.Keywords
All Related Versions
This publication has 32 references indexed in Scilit:
- Advanced Computational Methods and Geomechanics2023
- u‐p semi‐Lagrangian reproducing kernel formulation for landslide modelingInternational Journal for Numerical and Analytical Methods in Geomechanics, 2017
- Strain localization in a solid‐water‐air system with random heterogeneity via stabilized mixed finite elementsInternational Journal for Numerical Methods in Engineering, 2017
- TOUGH2Biot – A simulator for coupled thermal–hydrodynamic–mechanical processes in subsurface flow systems: Application to CO2 geological storage and geothermal developmentComputers & Geosciences, 2015
- A priori error estimates for the numerical solution of a coupled geomechanics and reservoir flow model with stress-dependent permeabilityComputational Geosciences, 2010
- Numerical simulation of fully saturated porous materialsInternational Journal for Numerical and Analytical Methods in Geomechanics, 2008
- Effective stress concept in unsaturated soils: Clarification and validation of a unified frameworkInternational Journal for Numerical and Analytical Methods in Geomechanics, 2007
- Solid–liquid–air coupling in multiphase porous mediaInternational Journal for Numerical and Analytical Methods in Geomechanics, 2003
- Two families of mixed finite elements for second order elliptic problemsNumerische Mathematik, 1985
- The finite element method with Lagrangian multipliersNumerische Mathematik, 1973