- Fix grid nodes lying on a triangle-mesh collider (exactly, or within float error) getting no
collision.
collide()skipped a collider whenever the node-to-projection distance was zero, so a flat mesh floor lying on a grid plane left that whole layer of nodes unconstrained and particles could sink through it.TriMesh.project_local_pointnow also returns the pseudo-normal of the feature it projects onto, andcollide()uses it for points within1.0e-4cell widths of the surface.
- Add an implicit grid solver, selected per simulation with
MpmData::integrator = MpmIntegrator::Implicit(ImplicitSolverParams { .. })on a pipeline built withMpmPipelineKernels { implicit: true, .. }(off by default). It replaces the explicit momentum-to-velocity update by backward Euler solved with Newton's method on the incremental potential, entirely on the GPU: each Newton iteration evaluates the trial state of every particle (deformation gradient projected for plastic models, stress, energy), solves for the direction with a matrix-free, mass-preconditioned conjugate gradient on the definiteness-fixed Hessian, and picks the step with a backtracking line search (on the incremental potential, or on the residual norm for models without an energy). This lifts the sound-speed bound on the substep length: stiff elastics run with a handful of substeps per frame.ImplicitSolverParams::semi_implicit()gives the one-linearization variant. Grid-level stick/slip conditions and fixed particles are Dirichlet conditions inside the solve; separating contacts stay explicit corrections. - Constitutive models take part in the implicit solve through the new
IImplicitParticleModelslang interface (slosh/models/implicit_interfaces.slang): a trial-state evaluation and a stress differential. The default models implement it, andLinearElasticModel/NeoHookeanModelgained anenergy_density. A custom model specialization must export anImplicitParticleModelalongsideParticleModelto compile the implicit kernels. - The particle update reads a new
IntegratorFlagsuniform (GpuSimulationParams::integrator_flags) and leaves the stress out of the APIC affine matrix when the implicit solver is active. Arun_g2phook that fuses the particle update must do the same. - The testbeds compile the implicit kernels and expose the integrator and its parameters in the settings window, with the last solve's Newton and CG statistics.
- The testbed settings window exposes the substep count: a fixed number, or the adaptive
[min, max]range (scenes still set their defaults on restart).
- Add the
GpuBoundaryCondition::non_reflecting(absorbing) boundary condition, based on Lysmer-Kuhlemeyer viscous dashpots. It lets outgoing elastic waves leave the domain instead of being reflected back into it, emulating an unbounded medium. See the newnon_reflecting22D demo for a side-by-side comparison with a reflecting boundary. - Add
ParticleModel::absorbing_pml, a perfectly-matched-layer absorbing material after Kurima, Chandra & Soga (arXiv:2407.02790). Particles carrying it form a layer around the region of interest whose coordinates are stretched, so outgoing waves slow and spread instead of returning; pair it withParticleDynamics::dampingover the same particles to dissipate them.models::pml_stretchcomputes the per-particle stretch from the layer geometry. It absorbs better than the dashpot boundary above (~0.2% vs ~1% of a reflecting wall's residual motion on a 2D impulse test) at the cost of the extra particles the layer needs. - The PML and the two items below sit behind the new
pmlcargo feature, off by default, mirrored in the shaders asSLOSH_PML. It shiftsDefaultParticleModelType::LEN(5 on, 4 off). - With
pmlon, grid nodes carry a per-direction mass (Node.directional_mass), so a material can rescale its own inertia per axis viaModelUpdateResult::mass_scale. The momentum update divides by it while gravity keeps acting on the real mass. Ordinary materials report a scale of one. A P2G hook replacing the built-in transfer must write this field too. - Add
ParticleDynamics::stiffness_damping, the stiffness-proportional half of Rayleigh damping. It adds a viscous stressa_K * C : sym(grad v)from each material's own elastic tensor, so unlike the mass-proportionaldampingit is blind to rigid-body motion. Supported by every built-in model. It tightens the explicit stability bound, whichWgTimestepBoundsaccounts for. - Grid nodes now get a collision reported up to
COLLISION_REPORT_CELLS(6.5) cells from a collider instead of 1.5, so the absorbing boundary above can grade its damping over a band several cells deep. The contact boundary conditions gate themselves on the distance to the surface and are unaffected. - Update to Rapier 0.32. This migrates most public APIs and internals to use
glaminstead ofnalgebra. - Fix a GPU validation error / panic on simulations with more than ~4.19M particles, caused by compute kernels dispatching more than 65535 workgroups along a single dimension. The affected kernels now clamp the dispatch and grid-stride over the particles.
- Add support for dynamic particle insertion.
- Add support for specializing the particle update logic using slang’s link-time specializaiton feature.
- Update dependencies.