novaphy.solvers.SolverIPC¶
Newton-aligned SolverBase adapter over libuipc
for mathematically guaranteed penetration-free Incremental Potential
Contact. Requires CUDA ≥ 12.4 and a build with NOVAPHY_WITH_IPC=ON.
When IPC is not built, both SolverIPC and IPCConfig resolve to None;
always feature-check before constructing:
if novaphy.has_ipc() and novaphy.solvers.SolverIPC is not None:
solver = novaphy.solvers.SolverIPC(model, novaphy.solvers.IPCConfig())
How It Works¶
- Shape conversion — NovaPhy shapes are converted to tetrahedral meshes consumed by libuipc.
- GPU Newton solver — libuipc solves the barrier-based contact problem on GPU.
- Barrier contact — a log-barrier potential guarantees no
interpenetration at the cost of a fixed
dtmatchingIPCConfig.dt.
The solver advances state through the standard solver.step contract; dt
and gravity are validated against the libuipc scene built at construction
time, and mismatches raise.
Constructor¶
| Parameter | Description |
|---|---|
model |
Required. Model from ModelBuilder.finalize(). |
config |
IPCConfig (dt, gravity, barrier distance, friction). |
Build with IPC¶
See Build from Source for the compiler matrix (GCC 11–13, Clang 19+, MSVC 2019+, CUDA 12.4).
Example¶
import novaphy
if novaphy.has_ipc():
config = novaphy.solvers.IPCConfig()
config.dt = 1.0 / 60.0
solver = novaphy.solvers.SolverIPC(model, config)
state = model.state()
control = model.control()
for _ in range(steps):
solver.step(state, state, control, None, config.dt)
When To Use¶
| Scenario | Recommendation |
|---|---|
| Guaranteed no-penetration (precise machinery, jamming, tight clearances) | Use IPC. |
| Real-time large scenes on commodity GPUs | Often SolverSemiImplicit is faster; profile first. |
| Deformable bodies (planned) | IPC is the future home; today only rigid. |
Limitations¶
- Fixed
dtrequirement: changingdtbetween steps requires reconstructing the solver. - CUDA-only: no CPU fallback.
- The deprecated top-level
novaphy.IPCWorldbackend container remains importable behind aDeprecationWarning; new code should useSolverIPC.
Demos¶
| Demo | What it shows |
|---|---|
python/demos/demo_ipc_stack.py |
Box stacking with guaranteed no-penetration. |