CPU versions of the hooks above (same maths, plain numbers).
Default parameters (plain JSON numbers). density (kg/m³) is required: it sets the particle mass.
Registry key.
OptionalplasticityOptional per-particle hook after F is advanced in G2P: plasticity (project F, update Jp), and anything else a material tracks per particle, such as temperature (e.g. lava cooling). Returns TSL nodes; anything left out stays as it was.
Fastest elastic wave speed for these parameters, m/s (the time step keeps dt ≤ cfl·Δx / (maxSpeed + c)).
Kirchhoff stress τ = P(F)·Fᵀ, pascals (a TSL mat3 node). Runs in P2G.
OptionalviscosityOptional kinematic viscosity ν, m²/s (the time step also keeps dt ≤ Δx² / (6ν)).
A constitutive model for MPMSolver: Kirchhoff stress (and optionally a plasticity return mapping) as TSL functions, the same in plain TypeScript for the CPU reference, and JSON parameters. Register it with registerMPMMaterial; a solver compiles in the materials named in its
materialsoption.The solver owns the transfers: per substep it runs P2G (mass, momentum and
-dt·V·(4/Δx²)·τinto the grid), the grid update and G2P (velocity, C,F ← (I + dt·C)·F, then MPMMaterial.plasticity).