trusty.mpm¶
MPM (CDPI) particle bodies (CPU / Accelerate / CUDA).
MpmMaterial
¶
The material every particle of an MPM body shares: MaterialModel.QuadraticVolume (a fluid) or MaterialModel.StableNeoHookean (an elastic solid; MpmScheme.Cdpi on the cpu and accelerate backends only).
MpmScheme
¶
WallNoSlipConfig
¶
add_mpm_particles
¶
add_mpm_particles(
world: World,
positions: ndarray[float64, (N, M)],
particle_volume: float,
material: MpmMaterial,
*,
scheme: MpmScheme | str = MpmScheme.Cdpi,
cell_size: float = 0.05,
cdpi_domain_scale: float = 0.5,
project_positive_definite: bool = True,
particle_contact_radius: float = 0.0,
friction_mu: float = 0.0,
) -> int
Add an MPM body; its presence activates the MPM module. positions is a (P, 3) array of particle positions; all particles share particle_volume and material. Raises on a material.model MPM does not run. The keyword arguments are the body's scheme, background grid and solver settings; scheme takes an MpmScheme or 'cdpi' / 'lite'. friction_mu is the body's surface Coulomb coefficient (>= 0); 0 is frictionless. One MPM body per world.
read_grid_cells
¶
Return (ijks, cell_size) for the live active sparse grid. ijks is an (N, 3) int32 array of cell integer coordinates; the cell with index (i, j, k) spans world AABB ([ics, (i+1)cs] x [jcs, (j+1)cs] x [kcs, (k+1)cs]). Returns an empty array before initialize() or for non-MPM simulators.
read_particles
¶
Return the current particle positions of the (single) MPM body as a (P, 3) array. Empty if the world has no MPM body.
attach_wall_noslip
¶
Enable the variational wall no-slip penalty on this world. Attach walls via trusty.contact.add_wall(world, name, V, F); the MPM module emits this term at simulator initialize().