Abstract
Partial differential equation (PDE)-based simulation is central to engineering analysis and design, yet constructing reliable finite element method (FEM) solvers from high-level physical descriptions remains labor intensive. This workflow requires physical interpretation, governing-equation formulation, weak-form derivation, numerical discretization, implementation, and runtime validation; an error at any stage can produce code that appears plausible but represents an incorrect or non-executable model. This paper presents an execution-verified framework for autonomous PDE-to-FEM solver synthesis using domain-adapted large language models (LLMs). The framework formulates solver synthesis as a structured reasoning process linking physical-semantic parsing, operator-level PDE assembly, boundary and initialcondition specification, variational formulation, finite-element discretization, executable FEniCSx/Gmsh code generation, and runtime verification. An execution-verified synthetic data factory generates reasoningto-code trajectories and a physics-aware correction corpus, enabling a compact 2-billion-parameter opensource model to learn relationships among physical assumptions, numerical formulation, solver implementation, and execution outcome. Evaluation on 75 unseen PDE problems across canonical, intermediate, and complex tiers shows that the adapted model achieves 100.0%, 93.3%, and 60.0% execution success, respectively, and obtains the strongest weighted ReasoningScore, SpecScore, execution rate, and RuntimeQualityScore among all baselines under a single-pass, no-repair protocol. These results show that reliable AI-assisted physics-based simulation depends not only on model scale, but also on structured domain supervision and execution-based validation. This work contributes a structured, execution-verified reasoning-supervision method for LLMs, applied here to automate FEM solver generation for PDE-based engineering simulations.