Question #657126 on Yade changed:
https://answers.launchpad.net/yade/+question/657126

Swapnil posted a new comment:
Thanks Jan.
I am trying to start with the sphere. creating a script and running it later.

Following is the script until now:

from yade import pack,plot
#create a cylinder and pack it with spheres
----------------------------------
pred=pack.inCylinder((0,0,0),(0,0,0.25),0.10)     
sp=pack.randomDensePack(pred,radius=0.01)
O.bodies.append(sp)
----------------------------------
yade.qt.Controller()
#create a steel sphere to act as the impactor
----------------------------------
idSteel=O.materials.append(FrictMat(young=210e9,poisson=.25,frictionAngle=.8,label="steel"))
O.bodies.append(sphere((0,0,0.30),0.05,material=idSteel))
----------------------------------
Now if I want to assign in the script a constant velocity of for example 0.025 
m/s in the negative Z-direction to this sphere do I use the following as the 
next commands 

sphere.state.blockedDOFs=`z´
sphere.state.vel=Vector3(0,0,-0.025)

or do i have to use the ID of this body and work as follows:

O.bodies[the ID of sphere].state.blockedDOFs=`z´
O.bodies[the ID of sphere].state.vel=Vector3(0,0,-0.025)
But when you run it using the script , you do not know the ID of the sphere. 
How do you retrieve the Id of the sphere created before so it could be used 
here. I am not sure if this is even a correct question. But I do not have the 
right idea :-)

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.

_______________________________________________
Mailing list: https://launchpad.net/~yade-users
Post to     : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp

Reply via email to