yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #02728
problem in running a script
hi,
I have written a script,
when I run it, the program become close.
the message in the terminal:
*terminate called without an active exception
Aborted
*do you know why YADE doesn't run it?
when I don't use *TranslationEngine*, there isn't any problem, but I have to
use this Engine.
*my script:*
import itertools
from yade import utils, pack,timing,plot,wrapper
planeSize=Vector3(0.1,0.08,0.02)
rSphere=0.005
#Add material
O.materials.append(FrictMat(young=74.1e9,frictionAngle=0.179,poisson=0.2,density=2500,
label='PlaneMaterial'))
O.materials.append(FrictMat(young=1e9,poisson=.25,frictionAngle=0.5,density=1e3,
label='MissileMaterial'))
# generate a FCC Pack
a=2*rSphere;
ret=[]
h=a*sqrt(2)/2
ii,jj,kk=[range(0,int((planeSize[0]-a-sqrt(2)*a/2)/(sqrt(2)*a))+1),range(0,int(planeSize[1]/h)),range(0,int(planeSize[2]/h))]
for i,j,k in itertools.product(ii,jj,kk):
x,y,z=0+rSphere+i*sqrt(2)*a,0+rSphere+j*h,0+rSphere+k*h
if j%2==0: x+= sqrt(2)*a/2. if k%2==0 else -sqrt(2)*a/2.
if k%2!=0: x+=sqrt(2)*a/2.
ret+=[utils.sphere((x,y,z),radius=rSphere,color=(1,0,1),material='PlaneMaterial')]
PlaneIds=O.bodies.append(ret)
for b in O.bodies:
bodyPosition=b.state.pos
if bodyPosition[0]==rSphere or bodyPosition[0]>=planeSize[0]-2*rSphere:
b.state.blockedDOFs=['x','y','z','rx','ry','rz']
if bodyPosition[1]==rSphere or bodyPosition[1]>=planeSize[1]-2*rSphere:
b.state.blockedDOFs=['x','y','z','rx','ry','rz']
yade.wrapper.Bo1_Sphere_Aabb.aabbEnlargeFactor=1.05
Missile=O.bodies.append(utils.sphere((planeSize[0]/2,planeSize[1]/2,0.1),0.01,color=[0,1,0],material='MissileMaterial')
)
O.initializers=[
BoundDispatcher([Bo1_Sphere_Aabb()])
]
O.engines=[
ForceResetter(),
BoundDispatcher([
Bo1_Sphere_Aabb()
]),
InsertionSortCollider(),
InteractionDispatchers(
[Ig2_Sphere_Sphere_Dem3DofGeom()],
[Ip2_FrictMat_FrictMat_FrictPhys()],
[Law2_Dem3DofGeom_FrictPhys_New()]
),
GravityEngine(gravity=[0,0,-9.81]),
TranslationEngine(subscribedBodies=[Missile],translationAxis=[0,0,1],velocity=-0.01),
NewtonIntegrator(damping=0.02)
]
O.dt=.2*utils.PWaveTimeStep()
O.save('/tmp/a.xml.bz2');
#O.run(100); o.wait(); print o.iter/o.realtime,'iterations/sec'
from yade import qt
qt.Controller()
v=qt.View()
v.axes=True
Follow ups