Learning, Solving and Optimizing PDEs with TensorGalerkin: an efficient high-performance Galerkin assembly algorithm
Shizheng Wen, Mingyuan Chi, Tianwei Yu, Ben Moseley, Mike Yan Michelis, Pu Ren, Hao Sun, Siddhartha Mishra
TL;DR
TensorGalerkin delivers a unified, high-performance framework for solving, learning, and optimizing PDEs with a variational structure by reformulating Galerkin assembly as a two-stage Map–Reduce pipeline that tensorizes local contractions and uses deterministic sparse projections via SpMM to assemble $K$ and $F$. This enables GPU-accelerated solvers (TensorMesh), physics-informed operator learning (TensorPils) that leverages analytical shape gradients, and end-to-end differentiable PDE-constrained optimization (TensorOpt) within PyTorch. Across 2D/3D elliptic, parabolic, and hyperbolic PDE benchmarks, the approach yields substantial speedups with maintained or improved accuracy compared to strong baselines (FEniCS, SKFEM, JAX-FEM, PINNs, PI-DeepONet). By enabling efficient many-query PDE workflows, TensorGalerkin provides a practical, scalable foundation for physics-informed learning and design optimization on unstructured meshes.
Abstract
We present a unified algorithmic framework for the numerical solution, constrained optimization, and physics-informed learning of PDEs with a variational structure. Our framework is based on a Galerkin discretization of the underlying variational forms, and its high efficiency stems from a novel highly-optimized and GPU-compliant TensorGalerkin framework for linear system assembly (stiffness matrices and load vectors). TensorGalerkin operates by tensorizing element-wise operations within a Python-level Map stage and then performs global reduction with a sparse matrix multiplication that performs message passing on the mesh-induced sparsity graph. It can be seamlessly employed downstream as i) a highly-efficient numerical PDEs solver, ii) an end-to-end differentiable framework for PDE-constrained optimization, and iii) a physics-informed operator learning algorithm for PDEs. With multiple benchmarks, including 2D and 3D elliptic, parabolic, and hyperbolic PDEs on unstructured meshes, we demonstrate that the proposed framework provides significant computational efficiency and accuracy gains over a variety of baselines in all the targeted downstream applications.
