Manuscript Offprint
arXiv:2611.00803Agent4FreeFem: A Verification-Guided Framework for Autonomous Topology Optimization
Abstract
Topology optimization has become an indispensable design tool in the aerospace, automotive, and mechanical engineering industries. Yet bringing a new problem from its description to an optimized result remains slow, expert-dependent, and unreliable: the workflow spans many manually connected stages, each new problem requires solver code to be written and debugged manually, and such code often fails or yields incorrect results. We present Agent4FreeFem, a pipeline driven by a large language model that turns a natural-language problem description into a set of verified optimization results without manual solver-code development or debugging. The pipeline keeps the problem definition unmodified, localizes errors using independent sources of evidence, and completes constrained repairs automatically, thereby providing efficient end-to-end automation, autonomous execution, and verifiable results. We evaluated Agent4FreeFem on a suite of single-physics and coupled multiphysics problems. Every case passed runtime verification and finished within the repair budget of each stage.
Keywords: Large language models, topology optimization, level-set method, code generation, self-correction
Mathematical Subject Classification: 49Q10, 68T50, 90C90
1 Introduction
Topology optimization determines the optimal material layout inside a prescribed design domain under given physical constraints, without assuming any preconceived structure. Since the seminal works [1,2], the method has grown into an indispensable industrial design tool [3]: it is used to lighten aerospace brackets and aircraft components, to stiffen automotive chassis and engine mounts, to shape mechanical parts, and to design civil structures, among others. By routinely saving material and reducing weight while improving structural performance, topology optimization shortens design cycles and lowers manufacturing cost, and with the spread of additive manufacturing its intricate optimized geometries have become increasingly manufacturable.
Despite this maturity, taking a new problem from a description to an optimized result remains slow, expert-dependent, and fragile. First, the process is time-consuming. The workflow spans many disconnected stages, including mathematical formulation, mesh generation, weak-form derivation, solver configuration, and tuning of the optimization loop, each handled in a separate tool; repeated cross-stage handoffs account for a substantial portion of the turnaround time. Second, the process requires a high level of
*School of Mathematical Sciences, East China Normal University, Shanghai 200241, China. (52300155021@stu.ecnu.edu.cn)
†SJTU Paris Elite Institute of Technology, Shanghai Jiao Tong University, Shanghai 200240, China. (gonghelin@sjtu.edu.cn)
‡Corresponding author. School of Mathematical Sciences, East China Normal University, Shanghai 200241, China. (sfzhu@math.ecnu.edu.cn) expertise. Every new problem requires a specialist who understands both the underlying physics and numerical computing to hand-write and debug the solver code. Third, the process suffers from low reliability. Hand-written solver code often compiles yet fails at runtime or converges to incorrect solutions because of errors in weak forms, signs, units, boundary conditions, or parameter scales, and locating such errors is itself a major effort. Recent benchmarks of LLM-generated finite-element code report similarly low pass rates [4, 5], confirming that merely writing code is far from producing a correct, runnable solver.
Large language models (LLMs) are capable of generating code [6], yet scientific coding remains challenging for them [7], and their finite-element code still exhibits low pass rates [4, 5]. For mechanics and engineering design, multi-agent LLM collaborations have been shown to solve mechanics problems [8], agentic LLMs have been fine-tuned for finite-element methods [9], and LLM agents generate CAD models from text [10]. On the industrial side, LLM-based virtual assistants are being embedded into commercial CAE products such as AnsysGPT [11], and autonomous agent systems built on reasoning-and-acting frameworks handle large-scale industrial scheduling [12], highlighting the practical demand for autonomous engineering pipelines.
Topology optimization has begun to attract LLM-based automation. Liang et al. [13] integrate large language models into the conceptual design stage of topology optimization: the model interprets the natural-language design requirements and supports the development of an initial conceptual design, yet its assistance stops at the pre-processing stage, since the downstream numerical pipeline, from the PDE formulation and discretization to the solver implementation, is still assembled by experts, and the model's output is not automatically linked to an executed optimizer. Yang et al. [14] use an LLM as an online optimization controller that monitors the convergence of a SIMP solver and adaptively selects its continuation parameters, but the LLM operates inside the existing solver that has already been written and debugged by experts, so the dominant cost of the workflow, writing and debugging the solver code itself, remains unaddressed. Heyrani Nobari et al. [15] train a deep generative foundation model that directly predicts optimized topologies in a shape- and resolution-free manner, which shifts the cost to data: it requires a large corpus of solved problems for training, inherits the distribution of that corpus, and produces designs without a PDE-constrained solve to verify the resulting designs. Lin et al. [16] present TO-Master, a tool-orchestrated LLM agent that assembles density-based topology-optimization models from natural-language instructions and drives a fixed JAX-FEM optimization core; the supported formulations are pre-implemented in the core, and the mesh and the boundary conditions are confirmed by the human user. Park and Chung [17] introduce a multi-agent framework, TopOptAgents, demonstrated on benchmark problems, in which a specification validator, a code team, and a design critic refine the formulation, the FEniCS implementation, and the converged designs through four interleaved loops, with the critic judging rendered designs against a rubric of validity, consistency, convergence, and design quality.
To address these challenges, we present Agent4FreeFem, an agentic pipeline that turns a natural-language problem description into a set of verified optimization results without manual solver-code development or debugging. The pipeline consists of four stages. During Initialization, an example-selection step first scores the problem files against a reference library and selects the most relevant reference examples; the LLM then parses the description into a structured problem specification and a mesh specification, annotating each value to indicate whether it was extracted from the source or designed to fill a gap, using the selected reference specifications as contextual guidance. Generation has the LLM write the solver code in the AutoFreeFEM domain-specific language [18] in accordance with that specification, aided by the selected reference programs and meshes. Execution runs the generated code through the AutoFreeFEM library and the FreeFem++ solver [19] with an automatic parameter sweep, producing optimized designs. Reflection has two responsibilities: when an execution produces no design snapshot at all, it classifies the failure as a program error, repairs the code, and re-executes; when the sweep runs to completion, it first performs an overall check of the designs and then post-processes the results, for example by composing the design screenshots and cleaning up the temporary files.
The central methodological principle of Agent4FreeFem is to preserve the problem definition, localize errors using independent sources of evidence, and perform constrained repairs automatically. This principle is implemented in three ways. First, every value in the specification carries its extracted/designed source annotation, so extracted values stay verbatim, designed values carry rationales, and the problem definition is never altered by any later stage. Second, the deterministic checks, the semantic review, and the real execution evidence locate errors independently of one another. Third, each repair modifies only the flagged entries, and cases that fail to pass within the repair budget are set aside for human review rather than silently accepted. This approach offers three main advantages:
-
Efficient connectivity. Problem parsing, mesh handling, code generation, solving, and parameter tuning are automatically chained inside a single pipeline, from the natural-language description all the way to the finished sweep; no manual handoff between stages is needed, so the entire flow proceeds efficiently.
-
Process autonomy. The modeling specification, the selection of reference examples, and the code generation are all performed autonomously by the LLM, and the pipeline automatically runs the solver and performs the parameter sweeps, so that no manual solver-code development is required. Each decision is recorded in an operation log, and the automatic parameter sweeps provide supporting evidence, making the results reproducible and auditable.
-
Process verifiability. The generated code undergoes deterministic static checks and runtime verification. If a check fails, the pipeline automatically classifies the error, repairs the code, and reruns it until the run passes or a given repair budget is exhausted.
We validate Agent4FreeFem with the level-set method on 34 different examples spanning 6 problem types: linear elasticity, nonlinear elasticity, linear thermal conduction, nonlinear thermal conduction, Stokes flow, and coupled thermo-elasticity. All 2,050 solver runs passed runtime verification: 2,048 runs from the 32 suite cases, 64 parameter combinations per case, and two runs from the extension cases.
The remainder of this paper is organized as follows. Section 2 reviews the preliminaries. Section 3 presents the methodology of Agent4FreeFem. Section 4 reports the experimental results. Section 5 concludes the paper.
Let () be a fixed, bounded, open design domain with a boundary . Let be a subdomain to be optimized. The level-set method for topology optimization [20–22] represents the design implicitly through
where with being the interface to be optimized between two subdomains. The material indicator is defined directly in terms of as follows
where .
A topology optimization model based on the level-set method can be expressed in the following general form
where denotes the total objective, is the scalar or vector state field, is the material-cost weight, is the state operator, and is the boundary-condition operator. The volume functional is defined by
Here, denotes a general performance functional determined by the state fields and the design. The level-set method has been applied in many fields related to geometric optimization and reconstruction (see, e.g., [23–28]).
The level-set function is transported so that the material interface moves [29,30], and the finite-element mesh is then rebuilt to conform to the updated interface, providing more accurate interface resolution than traditional fixed-mesh level-set methods [21,22]. At each optimization iteration, an -gradient flow is introduced by seeking a regularized descent field such that
where
is the symmetric gradient, is the diffusion coefficient, and denotes the Eulerian derivative of the objective at the current determined by in the direction [31]. Boundary constraints are additionally enforced through prescribed displacements and penalty terms on normal boundary motion.
To seek a local minimizer of (2.3), we evolve a time-dependent level-set function according to
subject to an initial condition and homogeneous Neumann boundary conditions, where denotes the evolution time. The transport equation is handled by a characteristic-based advection solver [32]. A first-order approximation of the characteristic update from step to is
where the step size controls the magnitude of the interface displacement. Subsequently, the finite-element mesh is rebuilt to follow the updated interface: the state problem is discretized on the updated geometry, and the remesher [33] keeps the element edges conforming to the interface and leaves the level-set function unchanged. A signed-distance function is then reconstructed on the new mesh using the fast marching method. The reconstructed function approximately satisfies the Eikonal condition
where denotes the updated material interface. This reconstruction restores the signed-distance representation without separately integrating a time-dependent reinitialization equation.
The resulting level-set update can be summarized as follows
where denotes level-set advection, denotes the remeshing operator, denotes the mesh at iteration , and denotes signed-distance reconstruction. The physical state is subsequently recomputed on the updated finite-element mesh, and the objective value is evaluated. A backtracking line-search procedure reduces the trial advection step when the objective fails to decrease. This process is repeated throughout the optimization. Since the objective is re-evaluated on the remeshed domain, the recorded objective value may increase. The acceptance criterion requires that the new value be lower than that of the previous iteration; if no tentative step within the line-search budget decreases it, the smallest tried step is taken. The optimization always runs the full iteration budget, and the reported design is the one attaining the smallest objective value over the whole history of the run.
The widely used finite-element environment FreeFem++ [19] allows a user to describe a PDE in a high-level language close to its weak formulation, while discretization, assembly, and solving are handled by the library.
AutoFreeFEM [18] raises the description level further: it is a symbolic Python layer on top of FreeFem++ in which the user symbolically defines the domain, fields, constants, objective functional, and weak forms, and the library generates the FreeFem++ optimization scripts together with IATFEX documentation of the problem. Its central object is the Lagrangian, assembled from the state fields, the test fields, the objective , and one weak-form expression. A companion optimization-setup routine then configures the level-set optimizer with the mesh, the mesh-size bounds, the gradient-flow diffusion coefficient and the advection step settings, the number of design iterations, the initial level-set function, and the boundary-label lists.
3 Methodology
Agent4FreeFem takes as input a natural-language description of a topology optimization problem and produces candidate optimized designs for automated verification and subsequent selection. Figure 1 gives an overview of the pipeline. Four stages run in one chain: Initialization selects the reference examples and turns the description into a formal specification, Generation turns the specification into solver code, Execution solves the problem, and Reflection acts as the last line of defense: an execution that produces no design snapshot is classified as a program error and repaired, and a completed sweep is overall-checked and post-processed. Two features cut across all four stages. First, every stage consumes exactly the artifacts the previous stage produced, so no intermediate result is ever transcribed or passed on by hand, and the pipeline can proceed from description to the optimized designs in one uninterrupted run. Second, every stage leaves a complete, append-only record of its inputs, outputs, and decisions, and every value in the formal specification carries a provenance annotation stating whether it was taken from the source or introduced by the model to fill unspecified details.
3.1 Initialization
The first stage turns the unstructured problem description into a unified form. It begins with example selection: an example selector scores all of the problem's input files against a reference library and packs the specifications of the highest-scoring examples above a prescribed threshold into the parser's context under a token budget, so the parser can base its design choices on the patterns of similar problems. The description may be a short statement of intent, a detailed technical document, or something in between, and may come with a mesh script that fixes the geometry. The model reads the description and, using the

Figure 1: Overall flow of Agent4FreeFem: from a natural-language description through the four stages to the optimized designs.
Table 1: The items checked on the generated specifications in the Initialization stage.
| Item | Contents | How |
|---|---|---|
| Provenance annotations | extracted/designed provenance, design rationale | Deterministic |
| Extraction completeness | constants, boundary conditions, objectives, requirements | Semantic review |
| Transcription fidelity | values, formulas, weak-form signs | Semantic review |
| Boundary and label rules | disjoint lists, roles, known labels | Deterministic |
| Field declarations | types, approximation spaces, test-function match | Deterministic + semantic |
| Units | canonical spelling, dimensional consistency | Deterministic + semantic |
| Initial design | parseability, solid presence, connectivity, prescribed seed, solid fraction | Deterministic + semantic |
| Mesh definition | mesh construction, border labels, domain dimensions, comments, identifiers | Deterministic |
| Cross-file consistency | labels, edges, lists | Deterministic |
| Physical plausibility | constants, settings | Semantic review |
| Review consistency | consistent verdicts across rounds | Semantic review |
selected reference specifications as contextual guidance, produces two structured specifications: a problem specification covering the physics, the fields and their approximation spaces, the material constants with their units, the boundary conditions, the objective and the weak forms, and the optimization settings; and a mesh specification covering the geometry, the boundary parametrizations with their labels, and the mesh resolution. Every entry in both specifications carries one of two annotations: extracted, when it is transcribed from the source, or designed, when the model completes what the source leaves open, together with a short rationale. This dual annotation is the backbone of the pipeline: extracted values are immutable ground truth that no later stage may change, while designed values remain explicitly marked as choices.
The generated specifications are accepted only after verification, as shown in Figure 2. A deterministic layer checks their syntactic well-formedness, the internal consistency of labels, roles, and lists, the mutual consistency between the two specifications, and compliance with a number of physical plausibility rules, and normalizes formatting irregularities mechanically. A second layer, the semantic reviewer, compares the specifications against the source document: nothing stated in the source may be omitted or contradicted, and nothing designed may be physically implausible. Both layers run every round. If either layer reports an issue, a repair step rewrites only the flagged entries and leaves everything else untouched, after which the loop re-checks. The loop repeats until both layers pass or a given repair budget is exhausted; when the budget is exhausted, the case is set aside for human review rather than being allowed to continue with known defects. A provided mesh script, when one exists, is treated as immutable input: it is checked once, frozen, and all mesh metadata is derived from it. Table 1 summarizes the items covered by the two layers and how each one is verified.

Figure 2: The Initialization stage: the description becomes two provenance-annotated specifications through generation, checking, review, and targeted repair.
Table 2: The items checked and normalized on the generated program in the Generation stage.
| Item | Contents | How |
|---|---|---|
| Program structure | import order, domain declaration, problem name, comments | Deterministic |
| Call forms | argument counts, names, types | Deterministic |
| Transcription | labels, initial design, iteration count, mesh filename, extracted constants | Deterministic |
| Expressible weak forms | component access, boundary-term labels, vector gradients, integral division, Dirichlet collisions | Deterministic |
| Penalty rules | placement, range, notation | Deterministic |
| Mathematical equivalence | formulas, weak forms | Semantic review |
| Parameter normalization | material-cost weight, mesh size, diffusion coefficient and advection step, initial design | Deterministic |
3.2 Generation
The second stage produces the solver program. In addition to the results of the Initialization stage, the writer receives the reference programs and meshes selected during that stage: the selected main programs exemplify the usage patterns of the language, while the selected meshes illustrate mesh-construction conventions. The writer translates the specification into the AutoFreeFEM symbolic language: the domain, the fields and test functions, the material constants, the material contrast, the objective, and the weak forms are expressed symbolically, and the level-set method is configured with the mesh, the mesh-size bounds, the advection settings, the iteration count, the initial , and the boundary-label lists. The resulting program provides a structured representation from which the AutoFreeFEM library later generates the FreeFem++ scripts together with LaTeX documentation of the problem.
The draft then passes through a static repair loop mirroring the first stage, with the same repair budget. A set of deterministic checks examines the program structure, the call forms, the transcription of the specification, and the validity of the parameter settings; a semantic reviewer checks, against the specification and the description, that every formula and weak form is mathematically equivalent to the specified one and that the program uses no feature the language cannot express. Together, the two layers aim to ensure that the generated solver program is structurally valid and consistent with the mathematical specification. Table 2 summarizes what is checked and normalized at this stage. Figure 3 illustrates the stage.

Figure 3: The Generation stage: the solver program is written from the specification with the selected reference examples, and the static repair and normalization steps finalize it.
3.3 Execution
The pipeline shown in Figure 4 launches the generated program, which emits the FreeFem++ scripts, and then runs the optimization. Because FreeFem++ does not report completion itself, the runner watches the stream of iteration snapshots the optimizer writes: a new snapshot resets a per-step clock, and a step that stalls for too long is terminated, so no run remains stalled indefinitely; the reason for any termination, whether a solver error, a stalled step, or a completed design loop, is recorded with the run.
A parameter sweep is then launched automatically. The material-cost weight, the diffusion coefficient, and the advection step are varied over a fixed parameter grid. Each combination runs in its own copy of the program in a bounded worker pool; within each run, the step attaining the smallest objective value over that run's history is taken as the run's result. For every parameter combination, this step produces a complete record of the code, parameters, exit status, objective history, and final design; the final design reported for each case is then selected by human inspection from these records.
3.4 Reflection
The last stage shown in Figure 4 closes the loop between execution and repair, and serves as the final validation stage: the static checks and the reviews of the initialization and generation stages already intercept the vast majority of errors, so reflection performs no repair in most cases. Reflection has two duties. First, when the executed group produces no design snapshot at all, the failure is classified as a program error: the program failed before writing any design. The text model then examines the program and repairs the code, and the repaired code is written back into the same group and re-executed; a program repair never creates a new group. Second, once the executed group produces design snapshots, reflection first performs an overall check: the vision model inspects the final design of every experiment against the problem and assesses whether at least one design is physically plausible. When the check fails, a design repairer, responsible for formulas, parameters, and other design-related issues, proposes a new group of variants, each a minimal edit of the code that already ran; a deterministic sanitizer enforces the execution contract on every variant; and the new group is executed and checked again, closing the execution-reflection loop. The loop repeats until the overall check passes or the repair budget is exhausted, and each round is packaged into the growing history together with its run evidence and images. The checked designs are then post-processed: their screenshots are composed into the figure mosaics and the temporary files are cleaned up. Table 3 summarizes the examinations applied in this stage.
Table 3: The examinations applied in the Execution and Reflection stages.
| Item | Contents | How |
|---|---|---|
| Execution contract | solver invocation, solver search, script writing | Deterministic |
| Program repair trigger | no design snapshot in the executed group ⇒ program error | Deterministic |
| Program scope | program writing, mesh construction | Text-model detector |
| Overall check | at least one correct design among the experiments | Vision-model judgment |
| Post-processing | screenshot mosaics, temporary-file cleanup | Deterministic |
| History packaging | code, parameters, consoles, images | Deterministic |

Figure 4: The Execution and Reflection stages: parameter-swept runs that produce no design snapshot are classified as program errors, repaired, and re-executed; a completed sweep passes the overall design check and is post-processed into the final figures.
4 Results
This section reports the experimental evaluation of Agent4FreeFem. All experiments used the DeepSeek-V4-Pro and DeepSeek-V4.1-Flash models with deterministic decoding. The Flash model performed the overall check of the Reflection stage, which consumes design images, while all other stages ran on the Pro model. The experiments were conducted on a single workstation equipped with an AMD Ryzen 7 9800X3D CPU, an NVIDIA GeForce RTX 5070 Ti GPU, and 64 GB of memory. The workstation ran Windows 11 with WSL2, under which the FreeFem++ solvers were executed. We report, in order, the overall statistics across the suite, eight representative designs covering the linear/nonlinear and thermal-diffusion/elasticity combinations, a component ablation study, error-injection experiments, and two extension cases: fluid flows and thermo-elasticity.
4.1 Overall Statistics
Each case follows the same workflow: the initialization and the generation stages produce one program template from the problem description, and this template is then executed under each of 64 parameter combinations, using a separate working copy for each run; Table 4 lists the parameter values swept. Table 5
Table 4: The parameter values swept by the pipeline. Each case is executed once under every combination of the three parameters, giving combinations per case; the diffusion coefficient and the advection step share the same grid for the elasticity and the thermal diffusion groups.
| Group | material-cost weight | diffusion coefficient | advection step |
|---|---|---|---|
| Elasticity | |||
| Thermal diffusion |
reports the number of nodes of the initial mesh of each case. The meshes consist of unstructured triangular elements. During optimization, the meshes are reconstructed to conform to the evolving material interfaces, resulting in changes in the numbers of mesh vertices and elements. The execution and reflection stages form a closed loop: a run that produces no design snapshot at all is classified as a program error, repaired, and re-executed, while a run that completes first undergoes the overall design check and is then post-processed. Whenever a run failed, it did so during startup, before any substantial computation started, and each such failure cost one program-repair round followed by a re-execution; the final round of each case ran the full 64-combination sweep to completion, passed the overall check, and was post-processed. In all the cases of the reported experiments, the overall check passed on the first attempt, no design-repair round was ever needed, which indirectly attests to the effectiveness of the large language model and of the overall architecture. The run counts in Table 5 report these loop rounds; the table also reports the runtimes. The 32 cases involved 2,048 completed parameter-sweep runs. Runtime completion indicates that the numerical optimization finished successfully, whereas design quality is assessed separately through the reflection-stage review and subsequent human inspection. The 64 runs of a sweep are computed in parallel on a bounded worker pool, so the execution times reported here are wall-clock times of the parallel sweep, not the sum of the individual runs.
The failures encountered across the suite were handled by the automated checking and repair loops rather than by a human debugger. Every repair loop is subject to a budget of one initial generation followed by at most ten repairs, eleven rounds in total, and a case that fails to pass within the cap is set aside for human review instead of proceeding. The maximum number of rounds in Table 5 was 10 (less than 11), so no case ever exhausted its budget. In addition, the final results of all cases were inspected by human experts, providing additional evidence of the numerical validity of the solutions.
These numbers substantiate the properties claimed in the Introduction. Efficient connectivity: every case ran from the description to the finished sweep without any manual handoff between stages, at a mean end-to-end runtime of 85 minutes 2 seconds per case, so the reported time per case is the complete cost of the automated workflow, from text to the optimized designs. Process autonomy: the specification, the reference-example selection, the code generation, and the parameter sweep of every case were completed autonomously by the pipeline, with no solver code written or debugged by hand. Process verifiability: every failure was caught by the deterministic checks, the semantic review, or the execution evidence, then classified, repaired, and re-executed until it passed; the component ablation study of Section 4.3 further quantified the contribution of the components to the success rate and the repair overhead.
4.2 Representative Designs: Elasticity and Thermal Diffusion
The eight cases below are grouped into four elasticity cases and four thermal diffusion cases, covering the linear variant of each physics and its corresponding nonlinear variant. In all cases, the void material is a thousand times weaker, i.e., . For each variant, the parameter combination judged most reasonable after human inspection of the sweep results is reported in Table 6.
Each case started from its natural-language description: the pipeline produced the specification, wrote the solver program, and swept the 64 parameter combinations. Because the sweep enumerated the full
Table 5: Per-case runtime statistics over the 32-case suite, compiled from the pipeline's per-case runtime summary. The Nodes column lists the number of mesh nodes of the initial mesh. The initialization and generation columns report per-case totals; the execution and reflection column reports the wall-clock time of the 64 parallel runs plus the reflection time. Each initialization and generation run count comprises one initial generation plus at most ten repairs; the execution and reflection run count is the number of loop rounds of Section 4.1.
| Type | Case | Initialization | Generation | Execution + Reflection | Total | ||||
|---|---|---|---|---|---|---|---|---|---|
| Nodes | Runs | Time | Runs | Time | Runs | Time | |||
| Linear elasticity | bridgePier | 6,932 | 3 | 17m08s | 3 | 26m49s | 3 | 76m02s | 119m59s |
| cantileverBeam | 2,947 | 5 | 30m31s | 3 | 13m42s | 1 | 18m56s | 63m09s | |
| elasticFoundation | 3,169 | 2 | 10m20s | 5 | 38m47s | 3 | 71m21s | 120m28s | |
| gravityDam | 2,947 | 6 | 35m45s | 1 | 9m26s | 2 | 41m11s | 86m22s | |
| hangingBracket | 2,947 | 2 | 11m26s | 3 | 38m06s | 1 | 10m34s | 60m06s | |
| mbbBeam | 4,489 | 3 | 22m17s | 3 | 44m12s | 1 | 17m37s | 84m06s | |
| pressureVessel | 2,947 | 3 | 20m32s | 4 | 34m34s | 2 | 40m26s | 95m32s | |
| shearWall | 2,947 | 5 | 33m45s | 3 | 17m09s | 1 | 8m11s | 59m05s | |
| Nonlinear elasticity | bridgePierNonlinear | 6,932 | 5 | 32m11s | 1 | 5m05s | 1 | 39m36s | 76m52s |
| cantileverBeamNonlinear | 2,947 | 10 | 59m14s | 3 | 25m21s | 1 | 77m08s | 161m43s | |
| elasticFoundationNonlinear | 3,169 | 4 | 25m20s | 8 | 68m26s | 1 | 34m10s | 127m56s | |
| gravityDamNonlinear | 2,947 | 3 | 37m26s | 5 | 57m51s | 1 | 53m05s | 148m22s | |
| hangingBracketNonlinear | 2,947 | 4 | 30m50s | 3 | 27m59s | 1 | 50m16s | 109m05s | |
| mbbBeamNonlinear | 4,489 | 9 | 114m52s | 4 | 35m14s | 2 | 140m05s | 290m11s | |
| pressureVesselNonlinear | 2,947 | 2 | 11m00s | 3 | 21m15s | 1 | 44m36s | 76m51s | |
| shearWallNonlinear | 2,947 | 2 | 12m08s | 1 | 3m58s | 1 | 35m25s | 51m31s | |
| Linear thermal diffusion | contactPadCooling | 4,373 | 5 | 29m46s | 1 | 2m51s | 2 | 26m40s | 59m17s |
| doubleSidedCooling | 3,721 | 8 | 36m20s | 3 | 21m32s | 3 | 42m10s | 100m02s | |
| doubleSinkColdPlate | 22,656 | 2 | 46m32s | 1 | 8m18s | 2 | 24m05s | 78m55s | |
| finCrossSection | 3,721 | 2 | 7m15s | 1 | 3m46s | 1 | 6m17s | 17m18s | |
| heatedPanel | 3,721 | 6 | 39m31s | 1 | 2m44s | 1 | 2m46s | 45m01s | |
| microchannelCell | 3,721 | 5 | 47m55s | 3 | 14m18s | 2 | 26m35s | 88m48s | |
| timPartialContact | 4,072 | 5 | 29m16s | 1 | 6m25s | 1 | 3m34s | 39m15s | |
| vtpColdPlate | 10,134 | 4 | 30m54s | 1 | 3m50s | 1 | 7m37s | 42m21s | |
| Nonlinear thermal diffusion | contactPadCoolingNonlinear | 4,010 | 2 | 13m03s | 4 | 26m03s | 1 | 11m45s | 50m51s |
| doubleSidedCoolingNonlinear | 3,721 | 3 | 27m27s | 1 | 4m27s | 1 | 11m52s | 43m46s | |
| doubleSinkColdPlateNonlinear | 3,833 | 6 | 37m27s | 1 | 4m43s | 1 | 7m18s | 49m28s | |
| finCrossSectionNonlinear | 3,721 | 3 | 17m50s | 2 | 13m45s | 1 | 10m37s | 42m12s | |
| heatedPanelNonlinear | 3,721 | 4 | 24m47s | 2 | 10m29s | 2 | 24m49s | 60m05s | |
| microchannelCellNonlinear | 4,405 | 3 | 18m27s | 2 | 10m11s | 2 | 35m12s | 63m50s | |
| timPartialContactNonlinear | 4,072 | 7 | 44m04s | 2 | 15m06s | 2 | 33m19s | 92m29s | |
| vtpColdPlateNonlinear | 6,694 | 7 | 68m18s | 5 | 34m19s | 1 | 13m21s | 115m58s | |
| Total | 140 | 1023m37s | 84 | 650m41s | 47 | 1046m36s | 2720m54s | ||
| Avg | 4.38 | 31m59s | 2.63 | 20m20s | 1.47 | 32m42s | 85m02s | ||
Cartesian product of the three parameters, many of the combinations yielded degenerate designs that barely departed from the initial checkerboard, developed disconnected or fragmented material layouts, or collapsed toward an almost empty or almost full design; the purpose of the sweep was to run them all and identify the combinations that yielded satisfactory designs, and the reported design of each case was the one judged most reasonable after human inspection of the sweep results.
Table 6 collects these combinations for all eight cases. Figure 5 shows the checkerboard initial designs on the mesh, and Figures 6 and 7 show, for the elasticity and the thermal diffusion cases respectively, the initial problem schematic together with the final designs of the linear and nonlinear variants. The two groups also show that problems with and without body loads are supported alike: the elasticity group carries no body force, while the thermal diffusion group is driven by body heat.
The shear wall is a structural element of a framed building that receives the entire lateral force of the floors above and carries the lateral load into the ground. The design domain is the plane-strain cross-section of the wall, a 2m by 1m rectangle. The bottom edge is the fixed foundation and the top edge carries a uniform tangential traction, both prescribed; the two lateral edges denoted by are free
Table 6: The parameter combinations judged most reasonable after human inspection of the sweep results for the eight representative cases.
| Shear wall | Pressure vessel | Cold plate | Two-sink plate | |||||
|---|---|---|---|---|---|---|---|---|
| Linear | Nonlinear | Linear | Nonlinear | Linear | Nonlinear | Linear | Nonlinear | |
| material-cost weight | 5 | 2.5 | 2.5 | 1 | 100 | 500 | 25 | 25 |
| diffusion coefficient | ||||||||
| advection step | ||||||||


Figure 5: The checkerboard initial design shared by all elasticity cases (left) and all thermal diffusion cases (right), shown on representative meshes.

(a) Shear wall initial.
(b) Shear wall, linear result.

(c) Shear wall, nonlinear result.

(d) Pressure vessel initial.
(e) Pressure vessel, linear result.
(f) Pressure vessel, nonlinear result.
Figure 6: The four elasticity cases: for each problem, the initial problem schematic (left column) and the final designs selected after human inspection of the sweep results for the linear (middle column) and nonlinear (right column) variants; the shear wall panels show the displacement field, and the pressure vessel panels show the material layout.
for design, as shown in Figure 6(a). The material is linear elastic and the ersatz constitutive law reads

(a) Cold plate.

(b) Result on cold plate (linear).

(c) Result on cold plate (nonlinear).

(d) Two-sink plate.
(e) Result on two-sink plate (linear).

(f) Result on two-sink plate (nonlinear).
Figure 7: The four thermal diffusion cases: for each problem, the problem schematic (left column) and the final designs selected after human inspection of the sweep results for the linear (middle column) and nonlinear (right column) variants; the cold plate panels show the temperature field.
where denotes the displacement and the stress. The objective balances the compliance term against the material cost. We consider (2.3) with subject to
where denotes the outward unit normal and the tangential traction is given by . The isotropic constitutive relation is
The tensor I denotes the identity tensor, and the Lamé constants are given by
where E = 200 is Young's modulus and is Poisson's ratio. The selected parameter combination is reported in Table 6; the corresponding displacement field is shown in Figure 6(b).
The initialization stage took five rounds, i.e., one generation plus four repairs. The first repair round corrected two issues: a field-declaration error, in which the test function had been listed as a physical field with a type and unit, and a boundary-label error, in which the list of design-edge labels had been left empty; the second repair round corrected the declaration of the adjoint equation. The generation stage took three rounds (one generation plus two repairs): the first repair round corrected missing constant declarations, including the weak factor, the domain sizes, and the Lamé constants; the second repair round corrected transcription errors: the domain size and the weak factor did not match the specification. Reflection passed the overall check and continued with the post-processing.
The nonlinear variant replaces the material with a nonlinear composite used in fibre-reinforced concrete: the stiffness grows wherever the material deforms most, which helps the wall carry the lateral load. Loads, supports, and the design setup are otherwise identical to the linear case; the only modification is the following strain-dependent stiffness law
Here, is the strain-hardening coefficient. As this strain-dependent law fails the major symmetry, no potential with as its gradient exists; the compliance term of the objective therefore serves as a general performance measure. AutoFreeFEM's symbolic differentiation generates the consistent tangent, including the derivative of the stiffness factor with respect to , and assembles the adjoint from it. Table 6 lists the parameter combination selected for this variant.
The pressure vessel end cap [34] is a flat vessel closure subjected to internal fluid pressure, carrying the pressure to the welded rim. As shown in Figure 6(d), the design domain is a plane-strain strip between two symmetry planes through the vessel axis. The pressurized top face and the fixed welded bottom rim are prescribed; the two lateral symmetry planes , with their roller conditions, are free for design. Consider (2.3) with subject to
The ersatz constitutive law (4.1) is the same as in the shear-wall case. Here, and are Young's modulus and Poisson's ratio, is the pressure, is the roller stiffness, is the horizontal displacement component, and is the axial unit vector. The parameter combination selected for this case is listed in Table 6.
For the full run of this case, the initialization stage took three rounds, i.e., one generation plus two repairs: the first repair round corrected a field-declaration problem and a unit-notation problem, and the second repair round corrected the integrand of the volume term in the objective. The generation stage took four rounds, i.e., one generation plus three repairs: the first repair round corrected field-declaration, objective-term, and load-sign problems, the second repair round corrected a call-form problem and the Dirichlet notation, and the third repair round corrected a missing Dirichlet label. Reflection fixed a few program issues. After the re-execution, the overall check passed and the post-processing proceeded.
The nonlinear variant uses the same end cap made of nonlinear steel. Loads, supports, and the design setup are otherwise identical to the linear case; the only modification is the following strain-dependent stiffness law
Here, is the strain-hardening coefficient. The compliance term of the objective serves as a general performance measure, and the consistent tangent and adjoint are likewise produced by AutoFreeFEM's symbolic differentiation. The corresponding parameter combination is reported in Table 6.
The four thermal diffusion cases, in contrast, are driven by uniform volumetric body heat. The cold plate is Bejan's classical volume-to-point benchmark [35]: heat is generated uniformly inside a power package, and all generated heat must be conducted to a small cooling region where the heat sink is attached. The design domain is a 1 m by 1 m square plate with uniform volumetric heating and a constant base conductivity. The central 0.2 m segment of the left edge, which is the cold patch, is maintained at the reference temperature, and every remaining boundary segment is insulated and free for design, as shown in Figure 7(a). The objective balances the dissipated thermal energy against the material cost, and the optimization produces conductive paths from the heated interior to the cold patch. More specifically, consider (2.3) with subject to
with the volumetric heat source and conductivity . The selected parameter combination is reported in Table 6; the corresponding temperature field is shown in Figure 7(b).
For this case, the initialization stage took four rounds (one generation plus three repairs): the three repair rounds involved repeated attempts to correct errors in the weak-material interpolation formula and the unit specifications. Reflection passed the overall check and continued with the post-processing.
The nonlinear variant models a semiconductor plate whose conductivity decreases as the plate heats up, so that the hottest regions are the least conductive. The geometry, the cold patch, the uniform heat source, and the objective structure stay as in the linear case; only the conductivity law changes, yielding a nonlinear thermal-diffusion model
The selected parameter combination is listed in Table 6.
The two-sink cold plate represents a similar configuration [35] with two cooling patches, one on each side edge, instead of one: the heat generated throughout the board must be conducted to the cooling patches, which are held at the reference temperature while every remaining boundary segment is insulated and free for design; the volumetric heat source and the conductivity stay at and . The selected parameter combination is reported in Table 6.
For this case, the initialization stage took two rounds, i.e., one generation plus one repair. The repair round corrected three issues: a mismatch between the field domain and the domain name, a field-declaration error in which the test function had been listed as a physical field with a type and unit, and a unit-notation error. Reflection fixed a few program issues. After the re-execution, the overall check passed and the post-processing proceeded.
The nonlinear variant uses a polymer dielectric whose conductivity increases with temperature. All other aspects of the two-sink configuration remain unchanged; only the material law changes, as follows
The pair thus contrasts the nonlinear conduction law with the linear one under the same geometry and heating. Table 6 reports the parameter combination selected for this variant. Figure 8 shows the objective history of the reported experiment of each case. Within each history, the design attaining the smallest objective value is the recorded design of that experiment.
4.3 Ablation Study: the Role of the Pipeline Components
We used a component ablation study to show how each component contributed to the success rate and computational overhead. The initialization, generation, and reflection stages share the same check-and-repair





Figure 8: Objective history of the eight cases: (a) shear wall (linear); (b) shear wall (nonlinear); (c) pressure vessel end cap (linear); (d) pressure vessel end cap (nonlinear); (e) cold plate (linear); (f) cold plate (nonlinear); (g) two-sink cold plate (linear); (h) two-sink cold plate (nonlinear).
logic, so we illustrate with the initialization stage here; the other two stages lead to similar conclusions. For the eight representative cases of Section 4.2, in addition to the normal pipeline, four variants were evaluated, each missing one component: the stage prompts, the manual knowledge, the reference examples, and the repair history. Every experiment was subject to the same repair budget as the normal version: one initial generation followed by at most ten repairs, for a maximum of eleven rounds. The number of rounds and the runtime were measured as described in Section 4.1; the normal-version data are the initialization columns of Table 5. Table 7 collects the rounds, times, and outcomes of the eight cases under the five configurations.
Table 7 also shows the information each component provides and the cost of losing it. The stage prompts provide a fixed output format and structured repair procedures, thereby constraining the open-ended task of structured problem modeling and simplifying the reasoning required during generation and repair; without them the outputs drift structurally. The manual knowledge provides the domain-specific patterns of the specifications and the physical criteria, thereby keeping the model outputs well-formed; without it, the model struggles to produce a valid specification. The repair history provides the record of the errors and the repair actions of the earlier rounds, thereby keeping the repairer from repeating the same mistakes; without it, the cases repeatedly oscillate between two or more error types and struggle to reach a correct result. The reference examples provide complete specifications of similar problems from the library, anchoring the parser's design choices to proven patterns; without them the cases took more rounds on average, and two nonlinear cases exhausted the budget. Three concrete examples illustrate the point. Without the manual knowledge, the pipeline failed to produce a valid specification for the pressure vessel end cap because the field remained empty across successive rounds; the case exhausted its 11-round budget and failed after 44m13s, up from 20m32s. Without the reference examples, the nonlinear pressure vessel end cap went from 2 rounds and 11m00s to 11 rounds and 68m21s, exhausting the budget. Without the repair history, the two-sink cold plate repeatedly made the same class of mistakes, taking eight rounds
Table 7: Component ablation of the initialization stage on the eight representative cases: the normal version, i.e., the initialization columns of Table 5, against variants with one component removed. Each cell is rounds/time; every experiment uses the same repair budget as the normal version, i.e., one generation plus at most ten repairs. † marks a budget-exhausted failure; no_examples, no_prompt, no_manual, and no_history denote the variants missing the reference examples, the stage prompts, the manual knowledge, and the repair history, respectively.
| Case | Normal | no_examples | no_prompt | no_manual | no_history |
|---|---|---|---|---|---|
| doubleSinkColdPlate | 2 / 46m32s | 3 / 20m02s | 11 / 35m27s† | 11 / 60m51s† | 8 / 46m53s |
| doubleSinkColdPlateNonlinear | 6 / 37m27s | 5 / 33m26s | 8 / 36m50s | 11 / 52m38s† | 4 / 25m36s |
| pressureVessel | 3 / 20m32s | 4 / 29m22s | 11 / 76m55s† | 11 / 44m13s† | 6 / 37m22s |
| pressureVesselNonlinear | 2 / 11m00s | 11 / 68m21s† | 10 / 30m53s | 11 / 42m40s† | 11 / 67m05s† |
| shearWall | 5 / 33m45s | 4 / 22m17s | 8 / 21m01s | 11 / 43m36s† | 4 / 36m06s |
| shearWallNonlinear | 2 / 12m08s | 4 / 28m38s | 8 / 30m00s | 11 / 46m04s† | 4 / 26m00s |
| vtpColdPlate | 4 / 30m54s | 4 / 25m11s | 10 / 35m48s | 8 / 36m56s | 3 / 22m05s |
| vtpColdPlateNonlinear | 7 / 68m18s | 11 / 85m14s† | 8 / 29m34s | 10 / 35m26s | 11 / 74m11s† |
| Success rate | 8/8 | 6/8 | 6/8 | 2/8 | 6/8 |
| Average rounds | 3.9 | 5.8 | 9.3 | 10.5 | 6.4 |
| Average time | 32m35s | 39m04s | 37m03s | 45m18s | 41m55s |
instead of two rounds before it finally passed. The removal of repair history was associated with more repair rounds, longer runtimes, and a lower success rate across the evaluated cases.
For the same task, the full pipeline achieved a 100% success rate with the lowest average number of rounds and the shortest average runtime; removing any component always reduced the success rate and/or increased the number of invalid attempts and the repair overhead. These results demonstrate the value of the pipeline components in improving reliability and reducing repair overhead by providing structured guidance, domain knowledge, and historical feedback.
4.4 Error-Injection Experiments
We used error-injection experiments to evaluate the pipeline’s ability to repair each class of error. As in the ablation study, we focus on the generation stage; the other two stages lead to similar conclusions. For the eight representative cases of Section 4.2, we injected one representative defect from each of the six injectable error classes of Table 2 (program structure, call forms, transcription, weak-form expressibility, penalty rules, and mathematical equivalence) into a copy of the case code, then started the generation repair flow, which continued until the generated code passed the generation-stage validation checks or the repair budget was exhausted. Table 8 collects the repair rounds and times of the 48 experiments.
Table 8 shows that all 48 injected-error experiments passed the generation-stage validation checks within the repair budget, yielding a 100% success rate. The deterministic checks caught the program-structure, call-form, transcription, weak-form expressibility, and penalty-rule errors directly, while the semantic review caught the mathematical-equivalence errors, so the two verification layers provided complementary error detection capabilities; every error class was repaired in 1.1–2.0 rounds and 13m13s–22m23s on average, with call-form errors the slowest, but still far below the budget. The pipeline thus repaired every class of generation error quickly.
4.5 Extension Cases: Fluid Flow and Thermo-Elastic Coupling
We also tested other types of optimization problems. The two extension cases below include a fluid-flow problem and a coupled thermo-elastic problem, and both were generated solely from natural-language descriptions.
Table 8: Error-injection experiments: one representative defect from each of the six injectable error classes of Table 2 is manually injected into a copy of the generated code of the eight representative cases, and the generation repair flow is started with the correct inputs. Each cell is repair rounds/time; the repair budget is at most ten repairs, and all 48 experiments pass.
| Case | Structure | Call form | Transcription | Weak form | Penalty | Math equivalence |
|---|---|---|---|---|---|---|
| doubleSinkColdPlate | 2 / 18m29s | 1 / 11m14s | 1 / 9m02s | 1 / 8m21s | 1 / 9m37s | 1 / 6m04s |
| doubleSinkColdPlateNonlinear | 1 / 10m42s | 6 / 52m18s | 1 / 13m19s | 1 / 13m13s | 2 / 19m47s | 2 / 23m00s |
| pressureVessel | 1 / 12m11s | 2 / 40m12s | 1 / 13m44s | 1 / 13m21s | 2 / 19m09s | 1 / 20m47s |
| pressureVesselNonlinear | 2 / 27m54s | 2 / 28m42s | 2 / 28m06s | 2 / 24m22s | 2 / 26m48s | 2 / 26m20s |
| shearWall | 1 / 18m21s | 2 / 18m59s | 1 / 13m04s | 2 / 17m42s | 1 / 13m56s | 1 / 10m50s |
| shearWallNonlinear | 2 / 16m08s | 1 / 8m42s | 1 / 11m47s | 2 / 17m24s | 1 / 10m16s | 1 / 7m43s |
| vtpColdPlate | 1 / 5m20s | 1 / 7m00s | 1 / 6m15s | 1 / 8m41s | 1 / 6m26s | 1 / 6m43s |
| vtpColdPlateNonlinear | 3 / 17m54s | 1 / 11m59s | 1 / 10m30s | 2 / 18m31s | 1 / 9m45s | 1 / 7m25s |
| Success rate | 100% | |||||
| Average rounds | 1.6 | 2.0 | 1.1 | 1.5 | 1.4 | 1.2 |
| Average time | 15m52s | 22m23s | 13m13s | 15m12s | 14m28s | 13m36s |
The fluid case is the level-set recast of the double-pipe benchmark [36], a topology optimization problem in Stokes flow [37]: the objective is to design channels connecting the two inlet regions on the left boundary to the two outlet regions on the right boundary while balancing energy dissipation against the fluid-volume penalty. The design domain is a 1.5 by 1 rectangle filled with a fluid of unit viscosity . The solid acts on the flow through a Darcy resistance whose inverse permeability is given by , with the fluid value and the solid value . On the left edge, two strips of width , centered at and , are assigned parabolic velocity profiles with a peak value of 1 at the center of each strip; the two outlet strips on the right edge are left free for the outflow, and the remaining boundary is treated as a no-slip wall. The initial mesh contained 3,662 nodes.
The objective combines the dissipated power, consisting of Darcy friction and viscous dissipation, with a material-cost term that controls the fluid volume: here the level-set function designates the fluid channel, so that in the fluid region and the volume functional measures the fluid volume. Consider (2.3) with subject to
where is the flow velocity, is the pressure, and denote the inlet strips on the left edge and the outlet strips on the right edge, respectively, denotes the prescribed parabolic strip profile, is the stress tensor, is the material-cost weight, and is the remaining no-slip wall. The optimization produced the bifurcated double-pipe design of Figure 9: two arms from the inlet strips merge in a wide central chamber and fork again to the outlet strips.
The thermo-elastic case [38] models the plane-strain cross-section of a long structure defined on a 4m by 1m rectangular domain. The solid has a Young's modulus of 32 MPa, a Poisson's ratio of 0.23, a density of , a coefficient of linear thermal expansion of , and a thermal conductivity of . On the left edge , a temperature profile is prescribed and imposed weakly through a Robin penalty term. The prescribed temperature increases linearly from at the bottom corner to at the top corner. The left and right edges are clamped by penalty terms; the top edge carries a uniform downward traction of magnitude ; gravity acts

Figure 9: Topology optimization of Stokes flow: problem schematic (top); initial design with the finite-element mesh (bottom left); and the velocity field of the optimized design (bottom right).
downward on every solid region; and the bottom edge is insulated and traction-free. The initial mesh contained 10,251 nodes.
The objective combines the material cost, a penalty on the horizontal displacement of the clamped edges, and a term that minimizes the downward displacement of the loaded edge. More specifically, consider (2.3) with subject to
with , , and . The stiffness , the thermal expansion coefficient , and the conductivity are material-interpolated: each equals its solid value given above in the solid region and one thousandth of that value in the void. Here, on is an ideal boundary condition, imposed approximately through a penalty term with coefficient rather than enforced strictly; the same coefficient also weights the displacement-penalty term in the objective. We set . The optimization converged to the design of Figure 10: the material concentrates in a load-carrying band that spans the domain between the clamped edges and is perforated where the load path is weak; the temperature field varies across the structure from the heated left edge.
5 Conclusion
We have presented Agent4FreeFem, a pipeline that turns a natural-language description of a topology optimization problem into a verified, optimized design without expert intervention. The pipeline chains four

Figure 10: The thermo-elastic case: problem schematic (top left); initial design (top right); the optimized design colored by the temperature field (bottom left); and the optimized design colored by the displacement field (bottom right).
stages, initialization, generation, execution, and reflection, under one methodological thread: the problem definition stays unmodified, errors are localized using independent sources of evidence, and constrained repairs are completed automatically, making the pipeline efficient, end-to-end, autonomous, and verifiable. The evaluation encompasses both single-physics and coupled multiphysics problems, and every case succeeded. The results demonstrate that the pipeline is a practical step toward making topology optimization more accessible by reducing the expertise required for solver-code development.
Acknowledgments
The authors would like to thank Olivier Pironneau, Frédéric Hecht, and Pierre-Henri Tournier of the Laboratoire Jacques-Louis Lions, Sorbonne Université, and Ahmed Chabib of Institut Polytechnique de Paris for their inspiration and guidance in this work.
This work was supported in part by the National Natural Science Foundation of China under grant Nos. 12471377 and U25A20200, and by the Science and Technology Commission of Shanghai Municipality under grant No. 22DZ2229014.
Data Availability
The code supporting this study is available at https://github.com/PierreCUI/Agent4optimization.
References
[1] Martin Philip Bendsøe and Noboru Kikuchi. Generating optimal topologies in structural design using a homogenization method. Computer Methods in Applied Mechanics and Engineering, 71(2):197–224, 1988.
[2] Ming Zhou and George I. N. Rozvany. The COC algorithm, Part II: Topological, geometrical and generalized shape optimization. Computer Methods in Applied Mechanics and Engineering, 89(1-3):309–336, 1991.
[3] Martin Philip Bendsøe and Ole Sigmund. Topology Optimization: Theory, Methods, and Applications. Springer, Berlin, 2003.
[4] Saeed Mohammadzadeh, Erfan Hamdi, Joel Shor, and Emma Lejeune. FEM-Bench: A structured scientific reasoning benchmark for evaluating code-generating LLMs. arXiv preprint arXiv:2512.20732, 2025.
[5] Nayantara Mudur, Hao Cui, Subhashini Venugopalan, Paul Raccuglia, Michael P. Brenner, and Peter Norgaard. FEABench: Evaluating language models on multiphysics reasoning ability. arXiv preprint arXiv:2504.06260, 2025.
[6] Mark Chen, Jerry Tworek, Heewoo Jun, Qiming Yuan, Henrique Ponde de Oliveira Pinto, Jared Kaplan, Harri Edwards, Yuri Burda, Nicholas Joseph, Greg Brockman, et al. Evaluating large language models trained on code. arXiv preprint arXiv:2107.03374, 2021.
[7] Minyang Tian, Luyu Gao, Shizhuo Dylan Zhang, Xinan Chen, Cunwei Fan, Xuefei Guo, Roland Haas, Pan Ji, Kittithat Krongchon, Yao Li, et al. SciCode: A research coding benchmark curated by scientists. Advances in Neural Information Processing Systems, 37:30624–30650, 2024.
[8] Bo Ni and Markus J. Buehler. MechAgents: Large language model multi-agent collaborations can solve mechanics problems, generate new data, and integrate knowledge. Extreme Mechanics Letters, 67:102131, 2024.
[9] Rushikesh Deotale, Adithya Srinivasan, Mahmoud Golestanian, Yuan Tian, Tianyi Zhang, Pavlos Vlachos, and Hector Gomez. ALL-FEM: Agentic large language models fine-tuned for finite element methods. Computer Methods in Applied Mechanics and Engineering, 457:118985, 2026.
[10] Aurel Schüpbach, Raul San Miguel, Julian Ferchow, and Mirko Meboldt. From text to design: A framework to leverage LLM agents for automated CAD generation. Proceedings of the Design Society, 5:1893–1902, 2025.
[11] Ansys, Inc. Ansys releases AI-powered virtual assistant AnsysGPT. Press release, April 2024. https://www.ansys.com/news-center/press-releases/4-11-24-ansys-releases-ansysgpt.
[12] Haram Seo and Minjoo Choi. A large language model-based agent system for interactive large-scale project scheduling. Journal of Computational Design and Engineering, 13(9):183–203, 2026.
[13] Zelong Liang, Yuan-Fang Zhang, Yingjun Wang, and Weihua Li. Integrating large models with topology optimization for conceptual design realization. Advanced Engineering Informatics, 67:103524, 2025.
[14] Shaoliang Yang, Jun Wang, and Yunsheng Wang. Large language models as optimization controllers: Adaptive continuation for SIMP topology optimization. Advances in Engineering Software, 223:104304, 2026.
[15] Amin Heyrani Nobari, Lyle Regenwetter, Cyril Picard, Ligong Han, and Faez Ahmed. Optimize any topology: A foundation model for shape- and resolution-free structural topology optimization. Advances in Neural Information Processing Systems, 38, 2025. arXiv:2510.23667.
[16] Haoju Lin, Wenchang Zhang, Weipeng Xu, Xiang Li, Tian Xu, and Tianju Xue. TO-Master: An LLM-agent framework for automated topology optimization. arXiv preprint arXiv:2607.01812, 2026.
[17] Hyunjee Park and Hayoung Chung. Self-refining topology optimization via an LLM-based multi-agent framework. arXiv preprint arXiv:2605.23273, 2026.
[18] Grégoire Allaire and Michael H. Gfrerer. AutoFreeFEM: Automatic code generation with FreeFEM and IATEX output for shape and topology optimization of non-linear multi-physics problems. Structural and Multidisciplinary Optimization, 67(12):213, 2024.
[19] Frédéric Hecht, Olivier Pironneau, Antoine Le Hyaric, and Kohji Ohtsuka. FreeFem++ Manual, third edition, 2012. https://doc.freefem.org/.
[20] Stanley Osher and James A. Sethian. Fronts propagating with curvature-dependent speed: Algorithms based on Hamilton-Jacobi formulations. Journal of Computational Physics, 79(1):12–49, 1988.
[21] Grégoire Allaire, François Jouve, and Anca-Maria Toader. Structural optimization using sensitivity analysis and a level-set method. Journal of Computational Physics, 194(1):363–393, 2004.
[22] Michael Yu Wang, Xiaoming Wang, and Dongming Guo. A level set method for structural topology optimization. Computer Methods in Applied Mechanics and Engineering, 192(1-2):227–246, 2003.
[23] Shengfeng Zhu, Xianliang Hu, and Qingbiao Wu. A level set method for shape optimization in semilinear elliptic problems. Journal of Computational Physics, 355:104–120, 2018.
[24] Jing Zheng, Shengfeng Zhu, and Fazlollah Soleymani. A new efficient parametric level set method based on radial basis function-finite difference for structural topology optimization. Computers & Structures, 297:107364, 2024.
[25] Vivien J. Challis and James K. Guest. Level set topology optimization of fluids in Stokes flow. International Journal for Numerical Methods in Engineering, 79(10):1284–1308, 2009.
[26] Xindi Hu, Yangwen Zhang, and Shengfeng Zhu. Efficient identification of geometric inverse sources of parabolic problems by model order reduction. Inverse Problems, 41(5):055015, 2025.
[27] Yixin Tan, Lingkang Yan, and Shengfeng Zhu. Structural topology optimization in linear and nonlinear elasticity using a discontinuous Galerkin finite element method. Control and Cybernetics, 53(1):283–315, 2024.
[28] Wei Fan and Shengfeng Zhu. Modeling, analysis, and numerical methods for shape identification of moving geometric inverse source and potential of parabolic problems. Inverse Problems, 41:105005, 2025.
[29] Grégoire Allaire, Charles Dapogny, and Pascal Frey. A mesh evolution algorithm based on the level set method for geometry and topology optimization. Structural and Multidisciplinary Optimization, 48(4):711–715, 2013.
[30] Grégoire Allaire, Charles Dapogny, and Pascal Frey. Shape optimization with a level set based mesh evolution method. Computer Methods in Applied Mechanics and Engineering, 282:22–53, 2014.
[31] Jan Sokolowski and Jean-Paul Zolésio. Introduction to Shape Optimization: Shape Sensitivity Analysis. Springer, Berlin, 1992.
[32] Kentaro Yaji, Masaki Otomori, Takayuki Yamada, Kazuhiro Izui, Shinji Nishiwaki, and Olivier Pironneau. Shape and topology optimization based on the convected level set method. Structural and Multidisciplinary Optimization, 54(3):659–672, 2016.
[33] Charles Dapogny, Cécile Dobrzynski, and Pascal Frey. Three-dimensional adaptive domain remeshing, implicit domain meshing, and applications to free and moving boundary problems. Journal of Computational Physics, 262:358–378, 2014.
[34] Bogdan Szybiński and Pawel J. Romanowicz. Optimization of flat ends in pressure vessels. Materials, 12(24):4194, 2019.
[35] Adrian Bejan. Constructal-theory network of conducting paths for cooling a heat generating volume. International Journal of Heat and Mass Transfer, 40(4):799–816, 1997.
[36] Patrick E. Farrell, David A. Ham, Simon W. Funke, and Marie E. Rognes. Automated derivation of the adjoint of high-level transient finite element programs. SIAM Journal on Scientific Computing, 35(4):C369–C393, 2013.
[37] Thomas Borrvall and Joakim Petersson. Topology optimization of fluids in Stokes flow. International Journal for Numerical Methods in Fluids, 41(1):77–107, 2003.
[38] Qi Xia and Michael Yu Wang. Topology optimization of thermoelastic structures using level set method. Computational Mechanics, 42(6):837–857, 2008.