← 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

honzik proposed the following answer:

Hi Arthur,

you can try to solve it with labels:

[...]
>O.engines=[
[...]
ForceEngine(force=(0,0,0),ids=[6],label='fEngine')
[...]
]

[...]
O.run(30000); O.wait()
fEngine.force[2] = 900
O.run();

I am not sure if it works.. if not, sorry for spam :-)
good luck
Jan


______________________________________________________________
> Od: "Arthur Mercier" <question152878@xxxxxxxxxxxxxxxxxxxxx>
> Komu: yade-users@xxxxxxxxxxxxxxxxxxx
> Datum: 15.04.2011 21:48
> Předmět: Re: [Yade-users] [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.
>
>_______________________________________________
>Mailing list: https://launchpad.net/~yade-users
>Post to     : yade-users@xxxxxxxxxxxxxxxxxxx
>Unsubscribe : https://launchpad.net/~yade-users
>More help   : https://help.launchpad.net/ListHelp
>

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