MeshGraphNets are Graph Neural Networks designed to solve mesh-based physical simulations. This post covers both standard MeshGraphNet (MGN) and Multi-Scale MGN (MS-MGN), published by Google DeepMind in 2021 and 2022 respectively. These ML-based solvers run much faster than traditional physics-based solvers, but generalise poorly to out-of-distribution conditions.


Standard MGN

MGN (and its variants) follow a standard three-step message-passing framework — encode, process, and decode. Physical (or dynamical) quantities are first encoded into latents, then processed, and finally decoded for the next time step.

Standard MGN — encode, process, and decode over the mesh and world graphs.

Standard MGN — encode, process, and decode over the mesh and world graphs.

1. Encode

Mesh Edge Features $\mathbf{e}{ij}^{(M)} = (\mathbf{u}{ij}, \|\mathbf{u}{ij}\|, \mathbf{w}{ij}, \|\mathbf{w}_{ij}\|)$

World Edge Features $\mathbf{e}{ij}^{(W)} = (\mathbf{w}{ij}, \|\mathbf{w}_{ij}\|)$

Node Features $\mathbf{x}_i = (\mathbf{X}_i, \mathbf{n}_i)$

2. Process

Mesh Edge Latents $\mathbf{h}{ij}^{(M)} = \text{MLP}^{(M)}\left(\mathbf{e}{ij}^{(M)}, \mathbf{x}_i, \mathbf{x}_j\right)$

World Edge Latents $\mathbf{h}{ij}^{(W)} = \text{MLP}^{(W)}\left(\mathbf{e}{ij}^{(W)}, \mathbf{x}_i, \mathbf{x}_j\right)$

Node Latents $\mathbf{h}i = \text{MLP}^{(V)}\left(\mathbf{x}i, \sum{j \in \mathcal{N}(i)} \mathbf{h}{ij}^{(M)}, \sum_{j \in \mathcal{N}(i)} \mathbf{h}_{ij}^{(W)}\right)$

3. Decode

Derivatives $\Delta\mathbf{X}_i = \text{MLP}^{(P)}(\mathbf{h}_i)$

Next State (First Order) $\mathbf{X}_i^{(t+1)} = \mathbf{X}_i^{(t)} + \Delta\mathbf{X}_i$

Next State (Second Order) $\mathbf{X}_i^{(t+1)} = 2\mathbf{X}_i^{(t)} - \mathbf{X}_i^{(t-1)} + \Delta\mathbf{X}_i$


Multi-Scale MGN