Skip to content

Ball / Sphere

The ball driver is a spherical object, defined by its center, radius, velocity and angular velocity. It can be used as a boundary condition (particles inside) or as an obstacle (particles outside).

Ball

register_ball

Parameter Description
id driver index
state ball state: radius and center (required), vel (default [0,0,0]), vrot (default [0,0,0]), rv, ra
params motion parameters, default { motion_type: STATIONARY }

Note

  • ra is the "radius acceleration" and rv the "radius velocity", used by the radial compression: the radius of the ball shrinks or grows until the requested pressure is reached between the ball and the particles inside. It requires the COMPRESSIVE_FORCE motion type.
  • With LINEAR_MOTION, the velocity vel is computed from motion_vector and const_vel.
  • With COMPRESSIVE_FORCE, the velocity vel is set to 0.

STATIONARY

1
2
3
4
- register_ball:
   id: 2
   state: {center: [2, 2, -20], radius: 7}
   params: { motion_type: STATIONARY }

Example: example/spheres/ball/driver-ball-stationary.msp.

LINEAR_MOTION

1
2
3
4
- register_ball:
   id: 1
   state: {center: [30, 2, -10], radius: 8}
   params: { motion_type: LINEAR_MOTION, motion_vector: [-1, 0, 0], const_vel: 0.5 }
Ball linear motion

Example: example/spheres/ball/driver-ball-linear.msp.

COMPRESSIVE_FORCE

1
2
3
4
- register_ball:
   id: 0
   state: {center: [0, 0, 0], radius: 11}
   params: {motion_type: COMPRESSIVE_FORCE, sigma: 1.0, damprate: 0.999}
Radial stress

Example: example/spheres/ball/driver-ball-radial-stress.msp.

TABULATED

1
2
3
4
5
6
7
- register_ball:
   id: 0
   state: {center: [0, 0, 0], radius: 7}
   params:
      motion_type: TABULATED
      time: [0, 25, 50, 75]
      positions: [[-20, 0, -20], [20, 0, -20], [20, 0, -15], [-20, 0, -15]]
Ball tabulated

Example: example/spheres/ball/driver-ball-tabulated.msp.