1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//! Core MPM solver algorithms and GPU kernels.
//!
//! This module implements the Material Point Method algorithm stages that run on the GPU:
//!
//! # MPM Algorithm Overview
//!
//! The MPM algorithm alternates between two representations of the simulation:
//! - **Particles** (Lagrangian): Track material points with mass, position, velocity, and deformation
//! - **Grid** (Eulerian): Temporary background grid for computing forces and velocities
//!
//! Each simulation step executes these phases:
//!
//! 1. **Particle-to-Grid (P2G)**: Transfer particle momentum and mass to nearby grid nodes
//! - Implemented by [`WgP2G`] and [`WgP2GCdf`] (for rigid body coupling)
//! 2. **Grid Update**: Compute forces, update velocities, apply boundary conditions
//! - Implemented by [`WgGridUpdate`] and [`WgGridUpdateCdf`]
//! 3. **Grid-to-Particle (G2P)**: Interpolate grid velocities back to particles
//! - Implemented by [`WgG2P`] and [`WgG2PCdf`]
//! 4. **Particle Update**: Integrate positions, update deformation gradients
//! - Implemented by [`WgParticleUpdate`]
//!
//! # Rigid Body Coupling
//!
//! The "CDF" (Collision Detection Field) variants handle two-way coupling with rigid bodies:
//! - [`WgRigidParticleUpdate`]: Updates particles sampled from rigid body surfaces
//! - [`WgRigidImpulses`]: Accumulates and applies forces from MPM to rigid bodies
//!
//! # Key Types
//!
//! - [`Particle`]: CPU-side particle data (position, velocity, material model)
//! - [`GpuParticles`]: GPU buffers storing all particle data
//! - [`ParticleDynamics`]: Physical state (velocity, deformation gradient, mass)
//! - [`ParticleModel`]: Material model (elastic, sand, etc.)
//! - [`SimulationParams`]: Global parameters (gravity, timestep)
pub use WgG2P;
pub use WgG2PCdf;
pub use WgP2G;
pub use WgP2GCdf;
pub use ;
pub use *;
pub use *;
// pub use particle_update::WgParticleUpdate;
pub use ;
pub use WgGridUpdate;
pub use WgGridUpdateCdf;
pub use WgGridUpdateCollide;
pub use WgParticleUpdate;
pub use ;
pub use WgRigidParticleUpdate;
pub use ;