save spheres coordinates to a file
hi every one ,
i am trying to save properties of spheres (id,x,y,z,r,force) in file during simulation each second (period=1 s) and add iteration number to base name each 1s.
the simulation is about filling a cylinder by pouring spheres under vertical vibration .
and this is what i obtain :
ArgumentError Traceback (most recent call last)
/usr/bin/yade in <module>()
/usr/bin/yade in myaddData()
43 def myaddData():
44 for b in bodies2:
---> 45 idt,rad=
46 x,y,z=O.
47 veloc,force=
and i have error in :
File "save.py", line 51, in <module>
yade.
AttributeError: No such attribute: addIternNum.
my script is :
#!/usr/bin/python
# coding: utf-8
from yade import pack,plot,export
#material of cylinder
Mat1 = O.materials.
# create Cylinder
Cylinder=
# create sphere packing
sp=pack.
sp.makeCloud(
sp.toSimulation
O.engines=[
ForceResett
InsertionSo
Interaction
),
NewtonInteg
HarmonicMot
# HarmonicMotionE
PyRunner(
]
O.dt=utils.
O.resetTime()
# open file
fil=open(
fil.write ('id \t x \t y \t z \t velocity \t radius \t force \n')
bodies2 = [b for b in O.bodies if isinstance(
print 'number of particles2 :', len(bodies2)
#saving parameters of spheres in file
def myaddData():
for b in bodies2:
idt,
x,
veloc,
fil.write("{:e} {:e} {:e} {:e} {:e} {:e} {:e}\n"
# add iteration number to basename
yade.wrapper.
O.saveTmp()
fil.close()
Any ideas ?
Thanks in advance.
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- hafsa
- Solved:
- Last query:
- Last reply: