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.
翻译:[translated abstract in Chinese]
大语言模型可减少建立有限元模拟所需的人工操作,但当生成的求解器代码处于关键路径时,会引入可靠性风险。我们提出一种面向多物理场有限元分析的受限自然语言接口,其中大语言模型被限定在前端任务:将提示解析为结构化JSON、仅为非标准几何体生成Gmsh代码,并针对这两个阶段使用重试反馈机制。它从不编写FEniCS求解器模板、推导弱形式或编写数值求解核心。确定性调度器将验证后的规范映射到五个手工编写的FEniCS/UFL模板:线弹性、超弹性、弹塑性、热力耦合及相场断裂。我们针对该确定性模板层,通过与解析解及已发表的二维/三维基准测试进行验证。在适当网格上,光滑案例的误差低于百分之一,而较难的非线性案例误差在百分之二至五范围内。我们还直接评估了面向LLM的前端。在15个提示的解析器基准测试中,首轮有效解析达9例,其余案例经重试后修复,最终有效解析率为100.0%,问题类别准确率100.0%,字段提取准确率97.1%。在10个自定义几何基准测试中,经真实LLM到Gmsh路径的完整流程,首轮与最终成功率均为90.0%,仅有一例不可恢复的无效几何失败。结果表明,解析器与受限提示/验证设计在这些基准测试中表现有效。作为端到端演示,系统通过单一自然语言提示生成并分析了含圆角和螺栓孔的3D弹塑性L型支架。本研究的贡献在于提出了一种用于自然语言驱动变分模拟的可测量架构,而非开放式的自主代码生成。