Abstract
We present a novel, and effective, approach to achieve optimal mesh relocation in finite element methods (FEMs). The cost and accuracy of FEMs is critically dependent on the choice of mesh points. Mesh relocation (r-adaptivity) seeks to optimise the mesh geometry to obtain the best solution accuracy at given computational budget. Classical r-adaptivity relies on the solution of a separate nonlinear "meshing" PDE to determine mesh point locations. This incurs significant cost at remeshing, and relies on estimates that relate interpolation- and FEM-error. Recent machine learning approaches have focused on the construction of fast surrogates for such classical methods. Instead, our new approach trains a graph neural network (GNN) to determine mesh point locations by directly minimising the FE solution error from the PDE system Firedrake to achieve higher solution accuracy. Our GNN architecture closely aligns the mesh solution space to that of classical meshing methodologies, thus replacing classical estimates for optimality with a learnable strategy. This allows for rapid and robust training and results in an extremely efficient and effective GNN approach to online r-adaptivity. Our method outperforms both classical, and prior ML, approaches to r-adaptive meshing. In particular, it achieves lower FE solution error, whilst retaining the significant speed-up over classical methods observed in prior ML work.
Introduction
Finite Element Methods (FEM) are indispensable in modern engineering, facilitating simulations ranging from atmospheric patterns to structural integrity. The accuracy of these simulations is intrinsically linked to the underlying mesh—the discrete grid of points where physical equations are solved. In scenarios featuring sharp gradients, such as shockwaves or localized turbulence, a higher density of points is required to maintain fidelity.
Mesh adaptation generally follows two paths: h-adaptivity (refining the mesh by adding points) and r-adaptivity (relocating existing points). While r-adaptivity preserves the degrees of freedom, determining the optimal point locations traditionally requires solving a secondary, computationally expensive nonlinear partial differential equation (PDE), such as the Monge-Ampère equation. This "meshing PDE" often becomes a bottleneck, rivaling the primary simulation in cost. While recent machine learning efforts have attempted to create fast surrogates for these classical methods, they typically fail to exceed the accuracy of the mathematical models they emulate.
Methodology: The G-Adaptivity Framework
G-Adaptivity introduces a paradigm shift by utilizing Graph Neural Networks (GNNs) to optimize mesh geometry directly. The framework is built on two core innovations:
Direct Error Minimization
Unlike previous surrogate models that mimic classical meshing PDEs, G-Adaptivity is trained to minimize the actual FEM solution error. By leveraging the adjoint capabilities of the Firedrake library, the network receives direct feedback on how individual node movements influence the final simulation error.
The Diffformer Architecture
To ensure physical validity, the authors propose the Diffformer, a novel GNN architecture based on a diffusion process. By modeling mesh relocation as controlled diffusion on a graph, the system provides a mathematical guarantee against mesh "tangling"—preventing overlapping or inverted elements that often plague automated relocation.
The framework also incorporates an equidistribution loss regularizer, ensuring that while points cluster in regions of interest, the overall mesh quality remains high.
Experimental Evaluation
The researchers benchmarked G-Adaptivity across a diverse set of challenging PDE problems:
- Poisson’s Equation: Evaluated on square, polygonal, and non-convex domains (e.g., L-shaped geometries).
- Viscous Burgers’ Equation: Testing the model's ability to track dynamic, time-dependent features.
- Navier-Stokes Equations: Simulating complex fluid flow past a cylinder.
- 3D Scalability: Demonstrated on a 3D unit cube Poisson test.
- Large-scale Generalization: Testing "super-resolution" capabilities on meshes with up to 22,500 nodes.
Key Results and Discussion
G-Adaptivity represents the first ML-based relocation method to consistently outperform the classical "gold standard" Monge-Ampère (MA) method in accuracy while maintaining significant speed advantages.
- Accuracy: In the Poisson Square benchmark, G-Adaptivity achieved a 21.01% error reduction, surpassing the 12.69% reduction of the classical MA method. As shown in the figure above, G-Adaptivity can achieve nearly 40% error reduction in a fraction of the time required by classical solvers.
- Efficiency: The relocation process is remarkably fast. For the Poisson problem, G-Adaptivity required only 88ms, compared to 3,780ms for the MA solver—a 43x speedup.
- Robustness: The model remained stable across complex, non-convex geometries where classical solvers often struggle to converge.
Conclusion and Future Directions
G-Adaptivity demonstrates that aligning GNN architectures with the underlying physics of mesh relocation can break the "surrogate ceiling." By targeting the true FEM error, it provides a faster and more accurate alternative to traditional r-adaptivity. Future research will focus on enhancing the generalization of these models to out-of-distribution physical phenomena and extending the framework to highly coupled multi-physics systems where manual mesh design is increasingly impractical.
Summary updated