← Back to team overview

yade-users team mailing list archive

Re: [Question #580450]: Applying differents force values

 

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

Jan Stránský posted a new comment:
O.foeces.permF(int), so both O.forces.permF(540) and
O.forces.permF(upBox.id) are correct, O.forces.permF(O.bodies[540])
would give you some error

once you have the value, you can do whatever you want with it, the most Yade-like approach would be to use plot module
#################
def plotAddData():
   plot.addData(
      i = O.iter,
      f540 = someValueGotWithPermF,
   )
   # plot.saveDataTxt(fileName) # save it periodically
O.engines = [
   ...
   plot.adddata(iterPeriod=..., command="plotAddData()"),
]
...
# saveDataTxt(fileName) # after simulation ends
################
Or you can save the value to a text file:

with open(fileName,'a') as f:
   f.write("{}\n".format(someValue))

Have a look at Yade doc and Python doc or write here or open new
question if something is not clear

cheers
Jan

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