Learning the Solution Operator of Boundary Value Problems using Graph Neural Networks

Winfried Lötzsch, Simon Ohler, Johannes S. OtterbachAI4Science @ ICML 2022 · DOI

Abstract

Traditional numerical solvers like the Finite Element Method (FEM) are computationally intensive, often requiring complete re-computation for any change in geometry or source distribution. This paper presents a Graph Neural Network (GNN) approach to learning the solution operator of static boundary value problems, specifically in electrostatics and magnetostatics. By treating the FEM mesh as a graph and utilizing spectral convolutions alongside a novel mesh augmentation strategy, the proposed model achieves significant speedups over traditional solvers. Crucially, the model demonstrates robust zero-shot generalization to unseen geometric shapes, effectively learning the underlying physical operator rather than just specific instances.

Introduction

In scientific computing, Partial Differential Equations (PDEs) are fundamental for describing physical phenomena such as electromagnetic fields and heat distribution. Solving these equations typically involves Finite Element Methods (FEM), which discretize the domain into a mesh. While accurate, FEM is computationally expensive and scales poorly when multiple simulations are required for varying parameters. Neural operators have emerged as a fast alternative, yet many struggle with irregular geometries or lack the ability to generalize beyond their training data. This work addresses these limitations by leveraging GNNs to solve PDEs on arbitrary meshes with high efficiency and flexibility.

Methodology

The authors implement an Encoder-Processor-Decoder GNN architecture designed to process unstructured meshes.

Graph Representation and Spectral Convolutions

The domain is represented as a graph where nodes correspond to mesh vertices and edges represent the triangulation connectivity. To capture long-range dependencies efficiently, the network employs spectral graph convolutions. This allows the model to have a broader receptive field, processing information from distant neighbors more effectively than standard local message-passing schemes.

Mesh Augmentation: The "Secret Sauce"

A key contribution of this work is the mesh augmentation strategy. To ensure the model learns the general physical principles (the solution operator) rather than memorizing specific mesh configurations, the training process includes random variations in node density, hole placement, and cutout dimensions. This forces the GNN to understand the relationship between boundary conditions and the resulting field across diverse spatial arrangements.

The U-shape geometry used to test the model's ability to generalize to unseen shapes in a zero-shot manner.

Experimental Setup

The model was trained and evaluated on a dataset of 37,500 simulations generated using the FEniCS library. The dataset covers electrostatics and magnetostatics across five 2D geometries: squares, disks, disks with holes, L-shapes, and U-shapes. The complexity was further varied by including between one and five sources (charges or currents) to test the model's ability to handle the superposition of solutions. The authors have made this dataset and their code publicly available to serve as a community benchmark.

Key Results

The GNN approach demonstrated substantial improvements in both speed and generalization capability.

Speed and Accuracy

On a GPU, the GNN solver is more than an order of magnitude faster than iterative FEM baselines. Even on a standard CPU, the GNN showed significant parallelization advantages. Despite this speed, accuracy remains high; scalar potential predictions achieved extremely low Mean Squared Error (MSE). The model also successfully learned the principle of superposition, accurately predicting fields for more sources than were present in the training set.

Generalization through Augmentation

The impact of mesh augmentation was profound. In shape generalization tests, models trained with augmentation reduced prediction errors by two orders of magnitude compared to those without. Notably, a model trained on squares, disks, and L-shapes could accurately predict the physics of a U-shape—a geometry entirely absent from its training set.

Comparison between ground truth (gt) and GNN predictions (pred) for electric potential and field on a disk with a hole.

Discussion and Future Work

While the results are promising, the authors identify areas for improvement. The current model occasionally produces small non-zero values for the curl of the electric field ($\nabla \times E$), which should physically be zero. Integrating "Physics-Informed" loss functions could enforce such constraints. Additionally, while the Poisson equation is a vital benchmark, future research will explore more complex, non-linear PDEs and the use of adaptive mesh refinement to handle regions of high field gradients more effectively.

Conclusion

This research demonstrates that GNNs, when combined with strategic mesh augmentation, can serve as powerful and flexible PDE solvers. By learning the solution operator rather than specific instances, these models provide a path toward real-time physical simulations on complex, unseen geometries.

Summary updated

BibTeX
@misc{lotzsch2022learning,
  author = {Winfried Lötzsch and Simon Ohler and Johannes S. Otterbach},
  title = {{Learning the Solution Operator of Boundary Value Problems using Graph Neural Networks}},
  year = {2022},
  eprint = {2206.14092},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2206.14092},
}
Figure