yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #17220
Re: [Question #668286]: save in txt.file a packing of spheres
Question #668286 on Yade changed:
https://answers.launchpad.net/yade/+question/668286
Status: Answered => Open
jacopo is still having a problem:
i was meaning that the code doesn't save me any positions, i see the
simulation running. it ends and save the plots value inside
'bbb.txt.bz2, but any file txt for the positions and radii is created: i
add the line code you suggest me but it still doesn't save nothing.
all the code is this now, it s really like deposition gravity, but i
have to save the positions of the spheres in a txt file at the end of
simulation:
from yade import pack, plot
# create rectangular box from facets
O.bodies.append(geom.facetBox((10,10,10),(10,10,10),wallMask=31))
sp=pack.SpherePack()
sp.makeCloud((0,0,0),(20,20,20),rMean=.3,rRelFuzz=.3)
sp.toSimulation()
O.engines=[
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
InteractionLoop(
# handle sphere+sphere and facet+sphere collisions
[Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom()],
[Ip2_FrictMat_FrictMat_FrictPhys()],
[Law2_ScGeom_FrictPhys_CundallStrack()]
),
NewtonIntegrator(gravity=(0,0,-9.81),damping=0.4),
# call the checkUnbalanced function (defined below) every 2 seconds
PyRunner(command='checkUnbalanced()',realPeriod=2),
# call the addPlotData function every 200 steps
PyRunner(command='addPlotData()',iterPeriod=100)
]
O.dt=.5*PWaveTimeStep()
O.trackEnergy=True
O.run(2000,True)
def checkUnbalanced():
if unbalancedForce()<.05:
O.pause()
plot.saveDataTxt('bbb.txt.bz2')
export.textExt('/tmp/compressed.txt','x_y_z_r_attrs',attrs=[])
# collect history of data which will be plotted
def addPlotData():
plot.addData(i=O.iter,unbalanced=unbalancedForce(),**O.energy)
plot.plots={'i':('unbalanced',None,O.energy.keys)}
plot.plot()
O.saveTmp()
--
You received this question notification because your team yade-users is
an answer contact for Yade.