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.

Each clump (group of spheres sharing state.clump_id) is treated 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). Properties are obtained by Monte Carlo integration via the shared batched kernel _union_properties_kernel(); single-sphere clumps keep their existing analytic state values.

This function performs host-side grouping of spheres into clumps, so it cannot be wrapped in jax.jit itself; the heavy Monte Carlo kernel it calls is jitted.