2. Contact mechanics fundamentals

Physics-aware graph neural networks for contact and boundary modeling only become interpretable once the underlying contact mechanics is explicit. A contact is not a bilateral joint: it can open, close, or slide, and the active state is unknown a priori. This chapter formalizes that behavior so it can later be encoded as graph structure, edge features, and loss terms. We adopt a consistent sign convention throughout: the outward unit normal n points from the body surface into the surrounding space, gap gn is positive when bodies are separated, and normal contact pressure pn ≥ 0 acts along −n on the body.

Unilateral constraints and the gap function

For two candidate contact surfaces, define the signed normal gap between a surface point xs on the slave body and its closest projection on the master surface:

g_n(x_s) = (x_s - x_m*) · n_m(x_m*),   x_m* = argmin ||x_s - x_m||

The unilateral (Signorini) constraint requires non-penetration and non-adhesion simultaneously:

g_n ≥ 0,   p_n ≥ 0,   g_n · p_n = 0

These three statements are the complementarity conditions in their simplest form. Physically: the gap cannot be negative (no penetration), pressure cannot be tensile (no adhesion), and at least one of the two must vanish at every point. A point is either open (gn > 0, pn = 0) or active (gn = 0, pn > 0). The set of active points is the contact patch, and it is an output of the problem, not an input.

Friction laws on the tangent plane

Once a point is active, tangential traction pt and relative tangential slip velocity vt must be related. The classical Coulomb law with a constant friction coefficient μ is itself a complementarity statement:

||p_t|| ≤ μ p_n
v_t = 0            if ||p_t|| < μ p_n        (stick)
v_t = -λ p_t/||p_t||, λ ≥ 0   if ||p_t|| = μ p_n   (slip)

Equivalently, define the slip function φ = ||pt|| − μ pn. Then φ ≤ 0, λ ≥ 0, and φλ = 0. This is a second complementarity pair, now on the tangent plane, and it couples to the normal problem through pn. For rate-dependent or regularized models, replace the sharp switch with a smooth law such as pt = −μ pn tanh(||vt||/v0) vt/||vt||, where v0 is a regularization velocity. This is common in simulation and in differentiable GNN training because it keeps gradients finite near the stick–slip transition.

A useful sanity check when implementing contact edges: for every candidate pair, exactly one of gn or pn should be near zero. If both are large, the solver has not converged; if both are near zero, the point is on the boundary of the active set and is numerically ambiguous.

From local conditions to a boundary value problem

Contact conditions are boundary conditions on an otherwise standard elasticity problem. On the body domain Ω with displacement u, the strong form is:

div(σ) + b = 0            in Ω
u = u_D                   on Γ_D
σ · n = t                 on Γ_N
g_n ≥ 0, p_n ≥ 0, g_n p_n = 0   on Γ_C
||p_t|| ≤ μ p_n,  φ λ = 0       on Γ_C

The contact boundary ΓC is where the difficulty concentrates: the boundary conditions are inequality-constrained and history-dependent (in the slip case), so the problem is a variational inequality rather than a linear system. The weak form seeks u in the admissible set K = {u : gn(u) ≥ 0 on ΓC} such that

a(u, v - u) ≥ l(v - u)   for all v in K

where a(·,·) is the bilinear form of linear elasticity and l(·) collects body and traction loads. Discretizing with finite elements yields a complementarity problem in nodal unknowns, typically solved by active-set iteration, semi-smooth Newton, or a penalty/regularized formulation.

Why this matters for graph neural networks

A GNN that predicts contact must respect the structure above. Three design consequences follow directly. First, candidate contact pairs should be edges with features (gn, n, relative velocity, material ids), and the network should output pn and pt per edge rather than a global field. Second, the complementarity residual gn·pn and the friction residual φλ are natural physics-informed loss terms; they are zero at the exact solution and grow with violation. Third, the active set is discrete and changes between load steps, so a purely feed-forward predictor will struggle at the stick–slip and open–close transitions unless the architecture or training schedule exposes those states.

Normal gap and pressure master body slave body g_n n p_n ≥ 0 Friction cone in tangent plane p_t1 p_t2 μ p_n stick slip Complementarity states per candidate contact edge OPEN g_n > 0 p_n = 0, p_t = 0 no traction transmitted STICK g_n = 0, p_n > 0 ||p_t|| < μ p_n v_t = 0 SLIP g_n = 0, p_n > 0 ||p_t|| = μ p_n v_t anti-parallel to p_t

Worked example: a single contact edge

Consider a 2D block resting on a rigid plane with μ = 0.4. The slave node has coordinates (0.50, 0.101) and the master surface is the line y = 0 with outward normal n = (0, 1). The gap is gn = 0.101, so the edge is open and pn = pt = 0. After a downward load step the node moves to y = −0.002, giving gn = −0.002. The constraint is violated, so the solver activates the edge and computes a normal pressure that pushes the node back to gn = 0. Suppose the converged pressure is pn = 1.2 MPa and the tangential traction demand is ||pt|| = 0.35 MPa. The friction limit is μ pn = 0.48 MPa. Since 0.35 < 0.48, the edge is in stick and vt = 0. If the tangential demand rose to 0.60 MPa, the edge would slip, and the returned traction would be clamped to 0.48 MPa along the direction opposing slip.

These numbers are illustrative, not measured. Their purpose is to show the decision sequence a GNN must learn to emulate: evaluate gn, decide open versus active, then evaluate φ and decide stick versus slip. Each decision is a discrete branch, and each branch has a distinct residual that can be monitored during training.

Practical checks and failure symptoms

  • Penetration residual: max(0, −gn) should approach zero. Persistent positive values indicate the normal branch is under-penalized or the active set is misclassified.
  • Tensile pressure: any pn < 0 violates the unilateral condition and usually signals a sign error in the normal convention or an unconstrained regression head.
  • Friction cone violation: max(0, ||pt|| − μ pn) should be zero. Large values mean the tangential head ignores the cone projection.
  • Chatter at transitions: oscillating open/closed labels between load steps often indicate a step size too large for the active-set iteration, or a regularized friction law with v0 set too small.
Do not train a contact GNN on pressure labels alone. Without the complementarity and cone residuals in the loss, the network can fit pressures while producing physically inadmissible states at open edges and slip boundaries, which will fail immediately when the model is coupled to a downstream solver.

With the local conditions, the friction cone, and the boundary value problem stated precisely, the next modeling decision is how to represent candidate contact pairs and their state transitions as graph elements. The complementarity structure above defines exactly which quantities each edge must carry and which residuals the learning objective must penalize.