O.run(1, True) for i in range(5): O.bodies[i].state.Vf = 0 O.bodies[i].state.Vmin = 0 O.interactions[id1,id2].phys.Vmax = 5.0 lqc.addLiqInter(id1, id2, 1.0) O.interactions[id2,id3].phys.Vmax = 5.0 lqc.addLiqInter(id2, id3, 1.0) O.interactions[id3,id4].phys.Vmax = 5.0 lqc.addLiqInter(id3, id4, 1.0) O.interactions[id3,id5].phys.Vmax = 5.0 lqc.addLiqInter(id3, id5, 1.0) O.run(1, True) vel = 1.0 O.bodies[id3].state.vel=[vel,0,0] O.bodies[id4].state.vel=[vel,0,0] O.bodies[id5].state.vel=[vel,0,0] from yade import qt qt.View()
vertices1 = ((.5, .5, 1.2), (0, .1, 2), (2, 0, 2), (0, 1, 2)) vertices2 = ((1, 0, 0), (0, 1, 0), (0, 0, 1), (1, 1, 1)) prepareExample(vertices1, vertices2, vel1=(0, 0, -1), label='\ntesting vertex-edge contact 2\n') elif O.iter == 8 * dt: vertices1 = ((0, 0, 0), (1, 0, 0), (0, 1, 0), (0, 0, 1)) vertices2 = ((0, 0, 1.2), (.9, .8, 2), (-.7, .61, 2.3), (0, -.7, 2.1)) prepareExample(vertices1, vertices2, vel2=(0, 0, -1), label='\ntesting vertex-edge contact\n') elif O.iter == 9 * dt: vertices1 = ((0, 0, 1.2), (.9, .8, 2), (-.7, .61, 2.3), (0, -.7, 2.1)) vertices2 = ((0, 0, 0), (1, 0, 0), (0, 1, 0), (0, 0, 1)) prepareExample(vertices1, vertices2, vel1=(0, 0, -1), label='\ntesting vertex-edge contact 2\n') elif O.iter == 10 * dt: O.pause() viewer = qt.View() plot.plots = {'i': 'e', 'i ': ('px', 'py', 'pz'), 'i ': ('lx', 'ly', 'lz')} O.step() O.step() O.step()
PyRunner(initRun=True, iterPeriod=1, command='addPlotData()') ] #### plot some results plot.plots = {'un': ('Fn', )} plot.plot(noShow=False, subPlots=False) #### create link (no time step needed since loading is involved in this step) O.step() # create link (cohesiveTresholdIteration=1) #### initializes now the interaction detection factor aabb.aabbEnlargeFactor = -1. Ig2ssGeom.interactionDetectionFactor = -1. #### time step definition ## no time step definition is required since setVelocities=False in StepDisplacer #### define simulation loading O.engines = [ StepDisplacer(ids=[1], mov=Vector3(0, +1e-5, 0), rot=Quaternion().Identity, setVelocities=False) ] + O.engines #### to see it v = qt.Controller() v = qt.View() rr = qt.Renderer() rr.intrAllWire = True
# support sphere O.bodies[0].state.blockedDOFs='xyzXYZ' # small dt to see in realtime how it swings; real critical is higher, but much less than p-wave O.dt=.01*utils.PWaveTimeStep() O.engines=[ ForceResetter(), InsertionSortCollider([Bo1_Sphere_Aabb()]), InteractionLoop([Ig2_Sphere_Sphere_L6Geom(distFactor=-1)],[Ip2_FrictMat_FrictMat_FrictPhys()],[Law2_L6Geom_FrictPhys_Linear(charLen=1)]), NewtonIntegrator(damping=0.1,gravity=(0,0,-9.81)), ] O.saveTmp() try: from yade import qt v=qt.View(); v.axes=True v.viewDir=Vector3(-0.888,-0.2,-0.4144) v.eyePosition=Vector3(18.16,8.235,5.12) v.sceneRadius=7.5 v.upVector=Vector3(-0.46,0.3885,0.798) v.screenSize=(900,900) rr=qt.Renderer() rr.intrGeom=True Gl1_L6Geom.phiScale=30; Gl1_L3Geom.uScale=20 #O.engines=O.engines+[ # qt.SnapshotEngine(fileBase=O.tmpFilename(),label='snapper',iterPeriod=300,deadTimeout=20), # PyRunner(iterPeriod=330000,command='utils.makeVideo(snapper.snapshots,out="beam-l6geom.avi"); snapper.dead=True; O.pause()') #] except ImportError: pass O.run()