Incremental Potential Contact

Incremental Potential Contact#

Frictionless Incremental Potential Contact for small CPU simulations.

The collision geometry, barrier derivatives, and continuous collision detection come from the official IPC Toolkit. PyTorch supplies the tetrahedral elasticity and the implicit adjoint of the converged time step.

class diffsim.ipc.IPCImplicitEulerSolver(dt=0.01, gravity=-9.8, damping=1.0, substeps=1, dhat=0.01, barrier_stiffness=100000.0, ground_height=None, newton_tolerance=1e-08, max_newton_iterations=50, max_line_search_iterations=25, armijo=0.0001, hessian_regularization=1e-09)[source]#

Bases: object

Dense, differentiable, frictionless IPC for small tetrahedral simulations.

Each substep minimizes the backward-Euler incremental potential containing inertia, Stable Neo-Hookean elasticity, and the official IPC barrier in one nonlinear solve. Every accepted Newton segment is limited by conservative CCD.

This solver is intentionally CPU-only and requires torch.float64. It protects accepted trajectories from surface intersections and tetrahedral inversion (and optionally includes an analytic ground plane), but it does not implement friction.

step(mesh, material, positions, velocities, masses, fixed_vertices=None, external_forces=None)[source]#

Advance one differentiable IPC time step.

external_forces may come from a neural network; gradients propagate through the converged implicit solution by the implicit function theorem.