jaxdem.utils.clumps#

Functions

compute_clump_properties(state, mat_table[, ...])

Compute mass / COM / inertia / orientation for every multi-sphere clump.

jaxdem.utils.clumps.compute_clump_properties(state: State, mat_table: MaterialTable, n_samples: int = 50000, sample_batch_size: int = 4096, clump_batch_size: int = 32) State[source]#

Compute mass / COM / inertia / orientation for every multi-sphere clump.

The function treats each clump (group of spheres sharing state.clump_id) as the union of its spheres with per-vertex material density mat_table.density[state.mat_id] (overlaps take the maximum density, never double-counted). It gets the properties by Monte Carlo integration via the shared batched kernel _union_properties_kernel(). Single-sphere clumps keep their existing analytic state values.

This function groups spheres into clumps on the host, so it cannot be wrapped in jax.jit itself. The heavy Monte Carlo kernel it calls is jitted.