A Constrained Natural-Language Interface for Variational Multi-Physics Finite Element Simulations in FEniCS
作者: Nilay Upadhyay, Wesley F. Reinhart
分类: cs.CE, cs.AI, cs.LG, physics.comp-ph
发布日期: 2026-06-09
备注: 23 pages, 17 figures
💡 一句话要点
提出受限自然语言接口以优化多物理场有限元模拟
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 自然语言处理 有限元分析 多物理场 Gmsh FEniCS 机器学习 工程模拟
📋 核心要点
- 现有方法在生成求解器代码时存在可靠性风险,限制了大型语言模型的应用。
- 提出的解决方案通过受限自然语言接口,将LLM的功能限制在前端任务,确保生成代码的可靠性。
- 实验结果显示,解析器的有效解析率达到100%,并在自定义几何体生成中取得90%的成功率,验证了方法的有效性。
📝 摘要(中文)
大型语言模型可以减少设置有限元模拟所需的手动工作,但在生成的求解器代码处于关键路径时会引入可靠性风险。本文提出了一种受限的自然语言接口,专注于多物理场有限元分析,其中LLM仅限于前端任务:将提示解析为结构化JSON,仅为非目录几何体生成Gmsh代码,并对这些阶段使用重试反馈。该系统通过五个人工编写的FEniCS/UFL模板进行验证,涵盖线性弹性、超弹性、弹塑性、热机械耦合和相场断裂。实验结果表明,该系统在解析和几何生成方面表现出色,最终有效解析率达到100%。
🔬 方法详解
问题定义:本文旨在解决大型语言模型在有限元模拟中生成求解器代码时的可靠性问题,现有方法在关键路径上存在风险。
核心思路:通过限制LLM的功能,仅用于解析提示和生成特定几何体的代码,从而确保生成的代码在关键路径上不会引入错误。
技术框架:整体架构包括前端解析模块、Gmsh代码生成模块和一个确定性调度器,后者将验证后的规范映射到五个预定义的FEniCS/UFL模板。
关键创新:最重要的创新在于受限的自然语言接口设计,使得LLM不再直接生成求解器模板或数值核心,降低了生成代码的风险。
关键设计:系统设计中包括解析提示为JSON的模块、对非目录几何体生成Gmsh代码的功能,以及重试反馈机制,确保高效和准确的解析与生成。该设计使得最终的有效解析率和几何生成成功率均达到高水平。
🖼️ 关键图片
📊 实验亮点
实验结果显示,在15个提示的解析基准测试中,首次有效解析率为60%,经过重试后最终有效解析率达到100%。在10个自定义几何体的基准测试中,首次和最终成功率均为90%,显示出该系统在解析和几何生成方面的高效性。
🎯 应用场景
该研究的潜在应用领域包括工程模拟、材料科学和结构分析等多个领域,能够显著提高有限元模拟的效率和可靠性。未来,该方法可能推动更多基于自然语言的工程工具的发展,使得非专业用户也能进行复杂的物理场模拟。
📄 摘要(原文)
Large language models can reduce the manual effort required to set up finite element simulations, but they introduce reliability risks when generated solver code lies on the critical path. We present a constrained natural-language interface for multi-physics finite element analysis in which the LLM is limited to front-end tasks: parsing prompts into structured JSON, generating Gmsh code only for non-catalog geometries, and using retry feedback for those stages. It never writes FEniCS solver templates, derives weak forms, or writes the numerical solver core. A deterministic dispatcher maps the validated specification to five human-written FEniCS/UFL templates: linear elasticity, hyperelasticity, elastoplasticity, thermo-mechanical coupling, and phase-field fracture. We validate this deterministic template layer against analytical solutions and published 2D/3D benchmarks. Smooth cases reach sub-percent agreement on adequate meshes, while harder nonlinear cases reach the 2-5 percent range. We also evaluate the LLM-facing front end directly. In a 15-prompt parser benchmark, first-pass valid parses were obtained for 9 cases, and all remaining cases were repaired after retry, giving a final valid parse rate of 100.0 percent, 100.0 percent problem-class accuracy, and 97.1 percent field-extraction accuracy. In a 10-case custom-geometry benchmark routed through the real LLM-to-Gmsh path, first-pass and final success were both 90.0 percent, with one unrecovered invalid-geometry failure. These results show that the parser and constrained prompt/validation design are effective on these benchmarks. As an end-to-end demonstration, the system generates and analyzes a 3D elastoplastic L-bracket with a fillet and bolt hole from one natural-language prompt. The contribution is a measured architecture for natural-language-driven variational simulation, not open-ended autonomous code generation.