← Back to team overview

yade-users team mailing list archive

Re: [Question #218848]: momentum

 

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

    Status: Open => Answered

Christian Jakob proposed the following answer:
Hi,

If no function is working as you wanted it, you can easily use python
itself to store your variables:

def writeOutput():
 momentum = ...
 f = open('my-outputfilename.out', 'a')
 f.write('%f' % (momentum))
 f.write('\n')
 f.close()

#then you can use PyRunner to add in into engines:

O.engines=O.engines+[PyRunner(iterPeriod=10,command='writeOutput()')]
#in this case it is called every 10th step

hope it helps,

christian.

-- 
You received this question notification because you are a member of
yade-users, which is an answer contact for Yade.