← Back to team overview

yade-users team mailing list archive

Re: [Question #152878]: confused about ForceEngine

 

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

    Status: Answered => Open

Arthur Mercier is still having a problem:
"1) Could you please, attach the problem script? It will be easier to
check your problem"
The scripts written were the complete ones.

"2) Replace "subscribedBodies" to "ids", subscribedBodies are not used
any more, I think."
Nice, it's working now.

But now, I have another question, I want to apply this force from a given iteration; for instance I want the force begins at the iteration number 30000. How can I do that ?
I tried to enter a pyrunner function but it doesn't work and I don't know how to configure the time "PyRunner(command='ForceEngine(force=(0,0,900),ids=[6])',iterPeriod=1)".
I also tried to create a function, before O.engines I create 'myfunction' and I run this function in O.engines with Pyrunner in O.engines: 
"def myFunction():
    if iter()>20000:
        ForceEngine(force=(0,0,900),ids=[6])

[...]

O.engines=[
	[...]
	PyRunner(command='myFunction()',iterPeriod=1),
	]"

And it's written 
"NameError                                 Traceback (most recent call last)

/home/arthur/yade/build/lib/yade-new/py/yade/__init__.pyc in <module>()
----> 1 
      2 
      3 
      4 
      5 

NameError: name 'myFunction' is not defined"
Each time I try to create a function by 'def something():', the same message occurs, so do I create a function or how do I apply a function/force from a given iteration?

Thanks !

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