New question #657911 on Yade:
https://answers.launchpad.net/yade/+question/657911

I am running the following script to perform a certain test  (penetration of a 
sphere into an assembly of other spheres). However, I am facing problems saving 
the plotted data. My script is as follows:

from yade import pack,plot
import os
pred=pack.inCylinder((0,0,0),(0,0,0.25),0.10)
sp=pack.randomDensePack(pred,radius=0.01,spheresInCell=300)
O.bodies.append(sp)
yade.qt.Controller()
idSteel=O.materials.append(FrictMat(young=210e9,poisson=.25,frictionAngle=.8,label="steel"))
hammer=sphere((0,0,0.30),0.04,material=idSteel)
hammerID=O.bodies.append(hammer)
hammer.state.blockedDOFs='z'
calm()
hammer.state.vel=Vector3(0,0,-0.5)
O.engines=[ForceResetter(),InsertionSortCollider([Bo1_Sphere_Aabb()]),InteractionLoop([Ig2_Sphere_Sphere_ScGeom()],[Ip2_FrictMat_FrictMat_FrictPhys()],[Law2_ScGeom_FrictPhys_CundallStrack()]),NewtonIntegrator(),PyRunner(iterPeriod=100,command="addPlotData()")]
def addPlotData():
  Dz=hammer.state.displ()[2]
  Fz=O.forces.f(hammerID)[2]
  plot.addData(i=O.iter,Fz=Fz,Dz=Dz)
plot.plots={'Dz':('Fz')}
plot.plot()
O.dt=0.5*PWaveTimeStep()
O.saveTmp()
O.run()
#plot.saveDataTxt(/home/zg/scriptf/respentry1.dat)
print os.path.abspath("/home/zg/scriptf/representary1.dat")


The last line is what I have to figure out in order to save the required data. 
I, however, do not see any data file by the name "representary1" at the 
mentioned location. The terminal displays the following message:

TCP python prompt on localhost:9003, auth cookie `ssdeyc'
XMLRPC info provider on http://localhost:21003
Running script pentry1.py
No suitable packing in database found, running PERIODIC compression
/usr/lib/x86_64-linux-gnu/yade/py/yade/pack.py:296: FutureWarning: The default 
behavior will change; specify returnSpherePack=True for the new behavior, and 
False to get rid of this warning (your code will break in the future, however). 
The returned SpherePack object can be added to the simulation using 
SpherePack.toSimulation()
  warnings.warn('The default behavior will change; specify 
returnSpherePack=True for the new behavior, and False to get rid of this 
warning (your code will break in the future, however). The returned SpherePack 
object can be added to the simulation using 
SpherePack.toSimulation()',category=FutureWarning)
/home/zg/scriptf/representary1.dat
[[ ^L clears screen, ^U kills line. F12 controller, F11 3d view (use h-key for 
showing help), F10 both, F9 generator, F8 plot. ]]
[0;34mYade [[1;34m1[0;34m]: [0m
-----

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.

_______________________________________________
Mailing list: https://launchpad.net/~yade-users
Post to     : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp

Reply via email to