GravityPrms(name="earth-gravity", acceleration=Vec3(0,-9.81,0)) ) #add a horizontal wall to act as a floor to bounce particle off: sim.createWall( name="floor", posn=Vec3(0,-10,0), normal=Vec3(0,1,0) ) #specify the type of interactions between wall and particles: sim.createInteractionGroup( NRotElasticWallPrms( name = "elasticWall", wallName = "floor", normalK = 10000.0 ) ) #add local viscosity to simulate air resistance: sim.createInteractionGroup( LinDampingPrms( name="linDamping", viscosity=0.1, maxIterations=100 ) ) #add a POVsnaps Runnable: povcam = POVsnaps(sim=sim, interval=100) povcam.configure(lookAt=Vec3(0,0,0), camPosn=Vec3(14,0,14)) sim.addPostTimeStepRunnable(povcam) #execute the simulation sim.run()
GravityPrms(name="earth-gravity", acceleration=Vec3(0,-9.81,0)) ) #add a horizontal wall to act as a floor on which to bounce particles: sim.createWall( name="floor", posn=Vec3(0,-10,0), normal=Vec3(0,1,0) ) #specify the type of interactions between wall and particles: sim.createInteractionGroup( NRotElasticWallPrms( name = "elasticWall", wallName = "floor", normalK = 10000.0 ) ) #add local viscosity to simulate air resistance: sim.createInteractionGroup( LinDampingPrms( name="linDamping", viscosity=0.1, maxIterations=100 ) ) #add a POVsnaps Runnable: povcam = POVsnaps(sim=sim, interval=100) povcam.configure() sim.addPostTimeStepRunnable(povcam) #execute the simulation sim.run()