用自然语言控制有限元仿真,确保代码可靠不越界。
A Constrained Natural-Language Interface for Variational Multi-Physics Finite Element Simulations in FEniCS

- LLM只负责解析指令、生成几何代码,不写核心求解器。
- 复杂问题误差2-5%,简单问题误差低于1%,验证通过。
- 适合希望快速启动多物理场仿真的工程师和研究者。
大型语言模型可降低有限元仿真设置的手动工作量,但生成的求解代码若处于关键路径则存在可靠性风险。本文提出一种受限的自然语言接口,用于FEniCS中的多物理场有限元分析:LLM仅执行前端任务——将提示解析为结构化JSON、仅对非标准几何生成Gmsh代码,并通过重试反馈优化。它绝不编写FEniCS求解模板、推导弱形式或实现数值求解核心。一个确定性调度器将经验证的规范映射到五个手工编写的FEniCS/UFL模板:线弹性、超弹性、弹塑性、热力耦合与相场断裂。该模板层通过解析解和已发表的2D/3D基准测试验证。平滑案例在合理网格下误差低于1%,非线性难题误差在2%-5%之间。直接评估前端:15个提示的解析测试中,首次有效解析率达9例,全部通过重试修复,最终有效解析率100.0%,问题类别准确率100.0%,字段提取准确率97.1%。10个自定义几何测试中,首次与最终成功率均为90.0%,仅一次几何无效无法恢复。结果表明,该解析器与受限提示/验证设计在基准测试中有效。作为端到端演示,系统仅凭一句自然语言提示即可生成并分析带圆角和螺栓孔的3D弹塑性L型梁。贡献在于一种有约束的自然语言驱动仿真架构,而非开放式的自主代码生成。
原文摘要 · Abstract (English)
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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。