← Back to team overview

yade-users team mailing list archive

Re: [Question #668286]: save in txt.file a packing of spheres

 

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

    Status: Open => Answered

Jan Stránský proposed the following answer:
Hello,

> i m new in yade

welcome :-)

> but is not working.

please always specify what "is not working" mean (I got his and that
error, the position saved is not the final one...).

Also please try to provide working examples. In this case I got
"KeyError: "No material labeled `ghiaia'."" and some NameErrors
afterwards..

Yade uses Python scripts to control simulation. Python reads and
executes line by line. So in your case, it saves the positions before
anything is run. You have several options:

1) run some time steps
O.run(2000,True) # note the True second parameter

2) do the save in a function:
def checkUnbalanced():
   if unbalancedForce()<.05:
      O.pause()
      plot.saveDataTxt('bbb.txt.bz2')
      export.textExt('/tmp/compressed.txt','x_y_z_r_attrs',attrs=[])
      # note the indentation, now it is part of checkUnbalanced function

cheers
Jan

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