4. Graph neural networks for mesh-based deformation fields
A crash simulation produces a mesh whose nodes move from an undeformed reference configuration to a deformed configuration under impact loading. Predicting that displacement field directly from geometry and loading conditions is the central learning problem of this course. Graph neural networks (GNNs) are a natural fit because a finite element mesh is a graph: nodes are mesh vertices, edges are element connectivity, and the quantity we want to predict — the per-node displacement vector ui ∈ ℝ³ — lives on the nodes. This chapter develops the message-passing formulation that turns that structural correspondence into a working predictor, and it explains the design decisions that separate a GNN that merely runs from one that generalizes across crash cases.
Why a graph view of the mesh is the right abstraction
A convolutional network assumes a regular grid with fixed neighbor offsets. A crash mesh has none of that: element sizes vary by orders of magnitude across a vehicle body, connectivity is irregular, and the same physical part may be meshed differently between studies. A GNN sidesteps all of this by operating on the adjacency structure itself. Each node aggregates information only from its topological neighbors, so the same learned weights apply to a 5 mm shell element in the B-pillar and a 20 mm solid element in the bumper, regardless of local valence or coordinate position.
Two properties matter for crash deformation specifically. First, message passing is permutation equivariant: reordering the node list does not change the predicted field, which is essential because mesh node numbering is arbitrary. Second, the receptive field grows with depth — after L layers, a node has seen information from its L-hop neighborhood. For a deformation field, this is physically meaningful: displacement at a node depends on the load path transmitted through nearby structure, and a 4–6 layer network typically captures a neighborhood of a few element rings, which is enough to sense local stiffness changes such as a spot weld or a bead.
The message-passing update
We use the standard edge-feature message-passing formulation. At layer l, each node i holds a hidden state hi(l), and each directed edge i→j holds an edge feature eij. The update proceeds in three stages:
# Per layer l, for every edge i -> j
m_ij = φ_e( h_i, h_j, e_ij ) # message from i to j
m_j = □_{i ∈ N(j)} m_ij # aggregation (sum or mean)
h_j' = φ_h( h_j, m_j ) # node update
# After the final layer L, read out displacement
u_i = φ_out( h_i^(L) ) # 3-vector per node
Here φe and φh are small MLPs, and □ is a permutation-invariant aggregator. Sum aggregation preserves the count of neighbors and is the usual choice when edge multiplicity carries physical meaning (e.g., duplicated nodes at a weld); mean aggregation normalizes for valence and is more stable when element sizes vary strongly. In practice, a sum aggregator followed by layer normalization works well for crash meshes because it retains magnitude information from high-valence regions near complex geometry.
Edge features: encoding the physics the nodes cannot see
Node coordinates alone are a weak input. Two nodes at the same position can belong to a stiff rocker panel or a soft energy-absorbing foam, and the network has no way to tell them apart unless the edge carries that information. Edge features are where most of the physical inductive bias enters the model. A practical edge feature vector for crash meshes combines:
- Relative position xj − xi in the reference configuration, plus its norm (the rest edge length).
- Direction cosines of the edge, which let the network learn anisotropic response along stiffening directions.
- Material or section identifiers as learned embeddings — steel grade, thickness class, foam, adhesive.
- Element type and characteristic length, so the model can compensate for mesh density differences.
- Boundary-condition flags propagated as a binary channel (clamped, symmetry, free).
Relative-position edge features are the single most important addition. Without them, a GNN is essentially a bag-of-nodes model and cannot distinguish a stretched edge from a compressed one. With them, the first message-passing layer already encodes local strain-like quantities, and deeper layers compose them into curvature and load-path information.
Node-level displacement prediction and the readout
The output head maps the final node embedding to a 3-vector. Two conventions are common and must be fixed before training, because mixing them silently corrupts the loss:
- Absolute displacement ui in the global frame, with the undeformed coordinates as the reference.
- Residual displacement relative to a linear or modal baseline prediction, which is often easier to learn because the baseline already captures global rigid-body motion.
For crash fields, the residual formulation usually wins: a linear static solve or a low-order modal superposition provides a cheap prior, and the GNN learns the nonlinear correction concentrated near folds, wrinkles, and contact zones. The readout MLP should output three channels with a linear activation; do not squash the output through tanh, since displacements are unbounded and saturation near large deformations will clip exactly the region you care about.
Assembling a working model: a concrete example
Consider a simplified B-pillar sub-assembly meshed with shell elements, roughly 40,000 nodes, subjected to a lateral impact prescribed as a velocity boundary condition on a rigid impactor. A reasonable starting configuration is:
| Component | Setting | Rationale |
|---|---|---|
| Input node features | reference position (3), boundary flag (1), material embedding (8) | position anchors the node; flags and material separate regions |
| Edge features | Δx (3), |Δx| (1), direction cosines (3), thickness class (1) | encodes local geometry and section stiffness |
| Hidden width | 128 | sufficient for ~40k nodes; wider gains are marginal |
| Layers | 5 message-passing layers | receptive field of ~5 element rings |
| Aggregator | sum, followed by LayerNorm | retains valence magnitude, stabilizes training |
| Output | 3-channel linear head, residual to linear baseline | learns nonlinear correction only |
| Loss | MSE on displacement, weighted 3× in the impact zone | focuses capacity where deformation is large |
Training uses a batch of load cases with varied impactor velocity and angle. A useful diagnostic during training is the per-node error map: plot the L2 displacement error over the mesh and check whether it concentrates at folds or at boundaries. Errors clustered at clamped boundaries usually indicate that boundary flags are not reaching the readout — increase depth or add a skip connection from the input flags to the output head. Errors spread uniformly across the field suggest underfitting; errors concentrated at sharp folds suggest the receptive field is too small or edge features lack curvature information.
What the graph structure buys you
The message-passing view makes the model's inductive biases explicit and adjustable. Depth controls the physical neighborhood; edge features control what physics the network can perceive; the aggregator controls how neighbor contributions combine; and the readout convention controls what the network must actually learn. Tuning these four levers, rather than adding parameters indiscriminately, is what makes a mesh GNN generalize from a handful of simulated crash cases to unseen geometries and loading conditions.