jaxdem.utils.random_state#

jaxdem.utils.random_state(*, N: int, dim: int, box_size: ArrayLike | None = None, box_anchor: ArrayLike | None = None, radius_range: ArrayLike | None = None, mass_range: ArrayLike | None = None, vel_range: ArrayLike | None = None, seed: int = 0) State[source]#

Generate N non-overlap-checked particles uniformly in an axis-aligned box.

Parameters:
  • N – Number of particles.

  • dim – Spatial dimension (2 or 3).

  • box_size – Edge lengths of the domain.

  • box_anchor – Coordinate of the lower box corner.

  • radius_range – min and max values that the radius can take. Defaults to (0.05, 0.1) times the smallest box edge.

  • mass_range – min and max values that the mass can take.

  • vel_range – min and max values that the velocity components can take. Defaults to (-1, 1).

  • seed – Integer for reproducibility.

Returns:

A fully-initialised State instance.

Return type:

State