# Dummy input
World = {'half_width':5, 'height':20, 'family':0}
sphere = {'radius':0.05, 'family': 1, 'idle_family':2, 'N_target':500000}
sphere['template'] = DEMSim.LoadSphereType(sphere['mass'], sphere['radius'], material)
# Set an idle family which does not interact with the environment
DEMSim.DisableFamilyOutput(sphere['idle_family'])
DEMSim.SetFamilyFixed(sphere['idle_family'])
DEMSim.DisableContactBetweenFamilies(sphere['idle_family'], sphere['idle_family'])
DEMSim.DisableContactBetweenFamilies(sphere['idle_family'], sphere['family'])
DEMSim.DisableContactBetweenFamilies(sphere['idle_family'], World['family'])
# Add spheres before initializing
dummy_pos = [[np.random.uniform(-World['half_width'] + sphere['radius'], World['half_width'] - sphere['radius']), np.random.uniform(-World['half_width'] + sphere['radius'], World['half_width'] - sphere['radius']), 0] for _ in range(sphere['N_stored'])]
dummy_vel = [[0.,0.,0.]] * sphere['N_stored']
sphere['object'] = DEMSim.AddClumps(sphere['template'], dummy_pos)
sphere['object'].SetVel(dummy_vel)
sphere['object'].SetFamilies([sphere['idle_family']]*sphere['N_target'])
sphere['tracker'] = DEMSim.Track(sphere['object'])
# Initialize
sphere['N_inserted'] = 0
DEMSim.Initialize()
# Run and insert spheres at the top of the geometry when possible
while sphere['N_inserted'] < sphere['N_target']:
if can_insert():
sphere['N_inserted']
sphere['tracker'].SetPos(pos=[0,0, World['height']-sphere['radius']], offset=sphere['N_inserted'])
sphere['tracker'].SetVel(vel=[0,0,0], offset=sphere['N_inserted'])
sphere['tracker'].SetFamily(fam_num=sphere['family'], offset=sphere['N_inserted'])
sphere['N_inserted'] += 1
DEMSim.DoDynamics(dt)