← Back to team overview

yade-users team mailing list archive

Re: [Question #222563]: tracking a sphere in a pack

 

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

    Status: Answered => Open

MOHAMMAD MOHSENI is still having a problem:
Dear Jan

I changed the code as you said but still have errors , can you please
kindley help me with this

from yade import pack, plot

O.bodies.append(utils.geom.facetCylinder((.5,.5,.5),radius=0.5,height=1,segmentsNumber=30, wallMask=4))
cylIds=O.bodies.append(utils.geom.facetCylinder((.5,.5,.5),radius=0.6,height=0,wallMask=1))
sp=pack.SpherePack()
O.materials.append(FrictMat(density = 4000, frictionAngle=90,young=1e9,poisson=.11))
sp.makeCloud((0.3,0.3,-0.5),(0.75,0.75,-0.75),rMean=.05,rRelFuzz=0, num=20)
b=O.bodies.append(utils.sphere(center=(0.35,0.35,-0.1),radius=.10,fixed=False))

sp.toSimulation()

O.engines=[
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
InteractionLoop(
[Ig2_Sphere_Sphere_L3Geom(),Ig2_Facet_Sphere_L3Geom()],
[Ip2_FrictMat_FrictMat_FrictPhys()],
[Law2_L3Geom_FrictPhys_ElPerfPl()]

),
GravityEngine(gravity=(0,0,9.81)),
NewtonIntegrator(damping=0.4),
RotationEngine(rotateAroundZero=True,zeroPoint=(0.5,0.5,0.5),rotationAxis=(0,0,1),angularVelocity=1000*(2*pi/60),ids=cylIds),
PyRunner(iterPeriod = 10, command="plotAddData()")

]
O.dt=.5*utils.PWaveTimeStep()

def plotAddData():
pos = b.state.pos
plot.addData( i=O.iter, x=pos[0], y=pos[1], z=pos[2] )

nIntrs = len( b.intrs() )
nIntrs = numIntrsOfEachBody()
plot.addData( i=O.iter, x=pos[0], y=pos[1], z=pos[2] ,nIntrs=len(b.intrs()

The Error we are getting is

1. For tracking the partcle p

NameError Traceback (most recent call last)
<string> in <module>()

NameError: name 'plotAddData' is not defined

2. For number of interactions

Traceback (most recent call last):
File "/usr/bin/yade", line 172, in runScript
execfile(script,globals())
File "plotandint.py", line 37

^
SyntaxError: invalid syntax


Many thanks

-- 
You received this question notification because you are a member of
yade-users, which is an answer contact for Yade.