Problem Representation¶
Every STARK simulation is built from two ingredients: state (inertial point and rigid body systems) and energies (the physics that act on that state).
State¶
STARK maintains two global state systems:
Point sets:
PointDynamicsholds all deformable objects. When you add a cloth, a tet mesh, or a cable, its state is appended to one shared array of 3D positions and velocities. This flat representation gives a clean internal structure and improves parallelization and vectorization. Each object is identified by itsPointSetHandler.Rigid bodies:
RigidBodyDynamicsholds one entry per rigid body, each representing a translation (3 DOFs) and an orientation quaternion mapped to an angular velocity (3 DOFs). Like point sets, all rigid bodies live in a single shared array. Each body is identified by itsRigidBodyHandler.
Energies¶
Mechanical effects and constraints are expressed as energy potentials that are functions of the current state. SymX differentiates them automatically to produce gradient and Hessian contributions to the Newton solver. Energies fall into three natural groups:
Deformable energies — act exclusively on point sets:
Energy |
Purpose |
|---|---|
|
Mass and Rayleigh damping for any topology (edges, triangles, tets) |
|
Penalty-based kinematic boundary conditions |
|
1D stretching for rods and cables |
|
2D membrane strain for cloth and shells |
|
Bending stiffness (Bergou discrete shells) |
|
3D volumetric FEM for soft bodies |
Rigid body energies — act exclusively on rigid bodies:
Energy |
Purpose |
|---|---|
|
Mass, inertia tensor, and Rayleigh damping |
|
All joints, motors, and springs between bodies |
Coupling energies — bridge the two state systems (or bodies of the same system):
Energy |
Purpose |
|---|---|
|
IPC-based frictional contact (d–d, rb–d, rb–rb) |
|
Penalty-based gluing of surface/point pairs |
Modelling an object typically requires composing multiple energies (e.g. inertia + triangle strain + bending for cloth). Presets wrap the most common combinations into single calls.