1. Course overview

Contact and boundary modeling is the part of computational mechanics where the physics is least forgiving. A deformable body pressing against a rigid obstacle, a fracture surface opening and closing, a fluid interface sliding along a wall, or a robot foot striking the ground all share the same difficulty: the active constraint set is unknown a priori, changes discontinuously during the simulation, and governs the accuracy of every quantity downstream. Classical finite element solvers handle this with iterative active-set detection, penalty or Lagrange multiplier formulations, and careful Newton linearization. Physics-aware graph neural networks (GNNs) aim to learn the same behavior from data while retaining the governing equations as structural priors, so that predictions remain stable, conservative, and transferable beyond the training distribution.

This chapter frames the scope of the course, identifies the technical challenges that make contact and boundary modeling a distinct learning problem, and maps the application domains where physics-aware GNNs have demonstrated practical value. It also establishes the notation and reference conventions used throughout the remaining chapters.

What "Physics-Aware" Means in This Context

A purely data-driven GNN trained on simulation snapshots treats contact as just another pattern in the node features. It can interpolate well inside the training distribution but frequently violates non-penetration, produces non-symmetric or non-positive-definite effective stiffness, and drifts in long rollouts. A physics-aware GNN constrains the hypothesis space in at least one of four ways:

  • Structural priors: the message-passing architecture encodes the discretized balance laws, for example by computing edge-wise fluxes that are summed conservatively at nodes.
  • Loss-level priors: residual penalties enforce linear momentum balance, non-penetration (a unilateral inequality), and friction-cone feasibility during training.
  • Hard constraints: output layers project predicted displacements or tractions onto the feasible set, so penetration is impossible by construction.
  • Hybrid coupling: the network replaces only the expensive constitutive or contact-law evaluation inside a classical solver, keeping the equilibrium iteration intact.

The distinction matters operationally. Structural and hard-constraint approaches generalize better to unseen geometries; loss-level priors are easier to implement but require careful weighting; hybrid coupling gives the strongest guarantees at the cost of tighter integration with an existing solver.

Key Technical Challenges

Unknown and changing active sets. At any instant, each candidate contact pair is either open (gap gn > 0, zero normal traction) or closed (gn = 0, compressive traction tn ≤ 0). The complementarity condition gn ≥ 0, tn ≤ 0, gn·tn = 0 defines the admissible state. A GNN must predict this switching behavior without smearing it into a smooth average, which is exactly where mean-squared-error training tends to fail.

Non-smooth gradients. The contact operator is only piecewise differentiable. Gradients through the active-set switch are undefined at the transition, so naive backpropagation produces noisy or vanishing signals. Common remedies include smoothed complementarity functions (Fischer–Burmeister), straight-through estimators, and implicit differentiation of the converged solver step.

Long-horizon stability. Autoregressive rollout accumulates error. Without energy dissipation or conservation structure, a learned contact model can inject spurious energy and diverge within a few hundred steps. Physics-aware designs typically add a symplectic or dissipative integrator and monitor total energy drift as a diagnostic.

Geometric generalization. Contact depends on local geometry—surface curvature, edge orientation, gap distance. A GNN trained on one mesh resolution must transfer to refined meshes and unseen shapes. Graph construction (radius graph versus k-nearest-neighbor), relative positional encodings, and normal-vector features all influence this transfer.

Scale separation and stiffness. Contact stiffness is often orders of magnitude larger than bulk stiffness, producing ill-conditioned systems. Learned models must respect this stiffness ratio or they will predict plausible-looking but mechanically wrong tractions.

A useful sanity check for any contact GNN: run a static indentation case and verify that the predicted normal traction is compressive everywhere on the contact patch, zero outside it, and that the integrated reaction force matches the applied load within a stated tolerance (for example 2%). Failures here usually indicate a loss-weighting or active-set problem, not an architecture problem.

Reference Conventions Used Throughout the Course

All chapters adopt a right-handed Cartesian frame. For a candidate contact pair, the gap is defined as gn = (xslave − xmaster) · n, where n is the outward unit normal of the master surface pointing toward the slave body. With this convention, gn > 0 means separation and gn < 0 means penetration. Normal traction tn is positive in compression, so the admissible closed state satisfies tn ≥ 0 and gn = 0. Tangential traction is bounded by the Coulomb cone ‖tt‖ ≤ μ tn. These sign conventions are fixed here and are not redefined in later chapters; any figure or equation that uses a different orientation states the change explicitly.

Where Physics-Aware Contact GNNs Are Applied

The application space is broad but shares a common structure: repeated queries of contact response under varying geometry, material, or loading, where a full FE solve is too slow for the outer loop.

Domain Typical contact/boundary object Why a learned surrogate helps
Robotics and grasping Soft finger pads, deformable objects on rigid supports Real-time tactile prediction inside control loops
Additive manufacturing Powder-bed compaction, part–support contact Fast distortion screening across many geometries
Biomechanics Cartilage–bone contact, implant–tissue interfaces Patient-specific parameter sweeps
Geotechnics Soil–structure interfaces, fracture surfaces Uncertainty quantification over many realizations
Digital twins Assembly clearances, wear evolution Online state estimation from sparse sensors

How the Course Is Organized

The course proceeds from formulation to implementation to validation. Early chapters develop the graph representation of contact surfaces, the message-passing operators that respect balance laws, and the loss and constraint formulations for unilateral contact and friction. Middle chapters address solver coupling, implicit differentiation, and rollout stability. Later chapters cover data generation, benchmark design, error metrics specific to contact (penetration depth, active-set mismatch, reaction-force error), and failure diagnosis. Each chapter includes a reproducible example with stated inputs, parameters, and observable verification criteria; example numbers are labeled as illustrative and are not presented as measured results.

Physics-aware GNN contact modeling: from geometry to constrained prediction A diagram showing a deformable slave body approaching a rigid master surface, the graph construction over candidate contact pairs, message passing with physics priors, and the complementarity state of each pair. Geometry & candidate pairs rigid master surface deformable slave g_n n Graph & message passing slave nodes (green) · master nodes (orange) dashed = candidate contact edges Physics priors balance-law messages non-penetration · friction cone Per-pair complementarity state OPEN g_n > 0, t_n = 0 CLOSED · STICK g_n = 0, ‖t_t‖ < μ t_n CLOSED · SLIP g_n = 0, ‖t_t‖ = μ t_n state switches are non-smooth; the network must respect them

The figure summarizes the pipeline that the course develops: geometric candidate detection produces a graph, message passing with physics priors produces per-pair predictions, and each pair is classified into one of three complementarity states. The state classification is not a post-processing convenience—it is the quantity that determines whether the predicted traction is admissible, and it is the primary target of the constraint formulations introduced in later chapters.

What You Will Be Able to Do

By the end of the course, you should be able to construct a graph representation of a contact interface from mesh or point-cloud data, implement message-passing operators that conserve linear momentum by construction, formulate training objectives that enforce non-penetration and friction-cone feasibility, couple a trained model to a Newton solver through implicit differentiation, and evaluate the result with contact-specific metrics rather than global displacement error alone. The first practical milestone appears in the next chapter, where a two-body indentation case is built end to end with stated parameters and a reaction-force verification criterion.