Re: [Yade-users] [Question #293179]: 'Name error' while calling function

2016-05-07 Thread subha
Question #293179 on Yade changed: https://answers.launchpad.net/yade/+question/293179 subha posted a new comment: Thanks Jerome. That post was very helpful indeed. -- You received this question notification because your team yade-users is an answer contact for Yade.

Re: [Yade-users] [Question #293179]: 'Name error' while calling function

2016-05-06 Thread Jérôme Duriez
Question #293179 on Yade changed: https://answers.launchpad.net/yade/+question/293179 Jérôme Duriez posted a new comment: As for # 11, I finally found the previous discussion I had in mind. See https://answers.launchpad.net/yade/+question/239546, which should tell you how to directly define variab

Re: [Yade-users] [Question #293179]: 'Name error' while calling function

2016-05-05 Thread subha
Question #293179 on Yade changed: https://answers.launchpad.net/yade/+question/293179 subha posted a new comment: Thanks Klaus, For some reason, option#1 resulted in a segmentation fault (core dumped) however option#2 worked but obviously at the expense of increased simulation time as you previou

Re: [Yade-users] [Question #293179]: 'Name error' while calling function

2016-05-05 Thread Klaus Thoeni
Question #293179 on Yade changed: https://answers.launchpad.net/yade/+question/293179 Klaus Thoeni posted a new comment: add #10: you have two options: 1. execute the line plot.saveDataTxt('file2.txt.bz2') in the terminal after you have finished the simulation 2. put the line back where you had

Re: [Yade-users] [Question #293179]: 'Name error' while calling function

2016-05-05 Thread subha
Question #293179 on Yade changed: https://answers.launchpad.net/yade/+question/293179 subha posted a new comment: Hi Jerome, Thanks for your comment. How do I define the scope of a function local or global in the script? Thanks, SM -- You received this question notification because your team

Re: [Yade-users] [Question #293179]: 'Name error' while calling function

2016-05-05 Thread subha
Question #293179 on Yade changed: https://answers.launchpad.net/yade/+question/293179 subha posted a new comment: Hi Klaus, I noticed that if O.run(N,False) is used, the script does not write the data in the text file, but saves the images. SM -- You received this question notification because

Re: [Yade-users] [Question #293179]: 'Name error' while calling function

2016-05-04 Thread Jérôme Duriez
Question #293179 on Yade changed: https://answers.launchpad.net/yade/+question/293179 Jérôme Duriez posted a new comment: Regarding #6, I think your problem arose from variable scope (global or local) -- rather than modules issues. Python variables / functions may have different scope (leading to

Re: [Yade-users] [Question #293179]: 'Name error' while calling function

2016-05-03 Thread Klaus Thoeni
Question #293179 on Yade changed: https://answers.launchpad.net/yade/+question/293179 Klaus Thoeni posted a new comment: Hi, by using execfile not all yade modules are imported correctly. Regarding your SnapshotEngine, just use it the way you had it before and make sure the directory you want to

Re: [Yade-users] [Question #293179]: 'Name error' while calling function

2016-05-03 Thread subha
Question #293179 on Yade changed: https://answers.launchpad.net/yade/+question/293179 Status: Answered => Solved subha confirmed that the question is solved: Thanks Klaus! It worked when executed with yade "filename.py". Just wondering what is the difference when the script is run using exe

Re: [Yade-users] [Question #293179]: 'Name error' while calling function

2016-05-03 Thread subha
Question #293179 on Yade changed: https://answers.launchpad.net/yade/+question/293179 subha confirmed that the question is solved: Thanks Klaus Thoeni, that solved my question. -- You received this question notification because your team yade-users is an answer contact for Yade. ___

Re: [Yade-users] [Question #293179]: 'Name error' while calling function

2016-05-03 Thread Klaus Thoeni
Question #293179 on Yade changed: https://answers.launchpad.net/yade/+question/293179 Status: Open => Answered Klaus Thoeni proposed the following answer: Hi, the script is working for me and I can't see why it shouldn't work. You should execute the script in the terminal as follows: yade

Re: [Yade-users] [Question #293179]: 'Name error' while calling function

2016-05-03 Thread subha
Question #293179 on Yade changed: https://answers.launchpad.net/yade/+question/293179 Status: Answered => Open subha is still having a problem: Hi Klaus, Thanks again to have a look at this. Sadly, the problem still persists. The outcome is: ameError Tracebac

Re: [Yade-users] [Question #293179]: 'Name error' while calling function

2016-05-03 Thread Klaus Thoeni
Question #293179 on Yade changed: https://answers.launchpad.net/yade/+question/293179 Status: Open => Answered Klaus Thoeni proposed the following answer: Hi, I didn't run the script previously but when looking at it in more detail now I can see there are a couple of issues. Below is a runni

Re: [Yade-users] [Question #293179]: 'Name error' while calling function

2016-05-02 Thread subha
Question #293179 on Yade changed: https://answers.launchpad.net/yade/+question/293179 Status: Answered => Open subha is still having a problem: Hi Klaus, Thanks for a prompt reply. I moved the function definition block before the engine declaration block as per your suggestion and executed t

Re: [Yade-users] [Question #293179]: 'Name error' while calling function

2016-05-02 Thread Klaus Thoeni
Question #293179 on Yade changed: https://answers.launchpad.net/yade/+question/293179 Status: Open => Answered Klaus Thoeni proposed the following answer: Hi, simply move the definition "def plotAddData():" before your engines. The function needs to be defined before calling it. HTH Klaus -

[Yade-users] [Question #293179]: 'Name error' while calling function

2016-05-02 Thread subha
New question #293179 on Yade: https://answers.launchpad.net/yade/+question/293179 Hi All, I am simulating a particle impact on a flat surface and would like to track the position and kinetic energy of the particle. I am using yade 1.07 version on Ubuntu 14.04 LTS. I encountered a problem with