yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #22704
Re: [Question #689821]: Any way to make my code run Faster
Question #689821 on Yade changed:
https://answers.launchpad.net/yade/+question/689821
Summary changed to:
Any way to make my code run Faster
Description changed to:
first question :
i try to run my code but i got a little bit problem that i's very slow
Do you have any way to make it run faster
this is my code :
from yade import pack
import matplotlib.pyplot as plt
idSteel=O.materials.append(FrictMat(young=210e9,poisson=.25,frictionAngle=.8,label="steel"))
O.materials.append(FrictMat(young=3e9,poisson=0.3,frictionAngle=radians(30),density=2600,label='spheres'))
# create rectangular box from boxes (maybe there is some library function, but I did not find it quickly)
cx,cy,cz = 6.3,6.3,6.3 # center of the box
dx,dy,dz = 7.5,7.5,7.5 # half-dimensions of the box
t = 0.25 # half-thickness of walls
left = box((cx-dx-t+1.2,cy+1.2,cz),(t,dy+2*t,cz),fixed=True,wire=True,material="steel")
right = box((cx+dx+t+1.2,cy+1.2,cz),(t,dy+2*t,cz),fixed=True,wire=True,material="steel")
front = box((cx+1.2,cy-dy-t+1.2,cz),(dx,t,cz),fixed=True,wire=True,material="steel")
back = box((cx+1.2,cy+dy+t+1.2,cz),(dx,t,cz),fixed=True,wire=True,material="steel")
bottom = box((cx+1.2,cy+1.2,cz-dz-t+1.2),(dx+2*t,dy+2*t,t),fixed=True,wire=True,material="steel")
left2 = box((cx-dx-t+1.2,cy+1.2,cz*2+2.7),(t,dy+2*t,2.7),fixed=True,wire=True,material="steel")
right2 = box((cx+dx+t+1.2,cy+1.2,cz*2+2.7),(t,dy+2*t,2.7),fixed=True,wire=True,material="steel")
front2 = box((cx+1.2,cy-dy-t+1.2,cz*2+2.7),(dx,t,2.7),fixed=True,wire=True,material="steel")
back2 = box((cx+1.2,cy+dy+t+1.2,cz*2+2.7),(dx,t,2.7),fixed=True,wire=True,material="steel")
top2 = box((cx+1.2,cy+1.2,18+t),(dx,dy,t),fixed=True,material="steel")
psdSizes,psdCumm=[0.0075,0.015,0.0425,.085,.2,.475],[0.,0.195,0.3145,0.6952,.9828,1.]
sp=pack.SpherePack()
# generate randomly spheres with uniform radius distribution
sp.makeCloud((0,0,0),(15,15,1.5),psdSizes=psdSizes,psdCumm=psdCumm,num=10000,seed=1)
# add the sphere pack to the simulation
sp.toSimulation(material='spheres')
Boxids=O.bodies.append((left,right,back,front,left2,right2,back2,front2,bottom))
O.engines=[
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Box_Aabb()]),
InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom(),Ig2_Box_Sphere_ScGeom()],
[Ip2_FrictMat_FrictMat_FrictPhys()],
[Law2_ScGeom_FrictPhys_CundallStrack()]
),
NewtonIntegrator(gravity=(0,0,-9.81),damping=0.4),
#PyRunner(command='addsphere()',iterPeriod=1000,label='adds'),
]
O.dt=0.001
--
You received this question notification because your team yade-users is
an answer contact for Yade.