erase certain engine

Asked by jessica sjah

Hi yade users,

In the triaxial example given by bruno, I read about how to insert an engine in "O.engines" by using O.engines.insert(4,PyRunner(iterPeriod=20,command='history()',label='recorder')).
Actually is it possible to remove/erase an engine in "O.engines"? How to do it?

Thank you.

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Anton Gladky
Solved:
Last query:
Last reply:
Revision history for this message
Best Anton Gladky (gladky-anton) said :
#1
Revision history for this message
jessica sjah (jessica-sjah) said :
#2

Hi anton,

thank you for your reply.
I have one more question.
How can I apply the "dead" command?

For example I have this engine:

O.engines=[
   ForceResetter(),
   InsertionSortCollider(....),
   InteractionLoop(....),
   GravityEngine(....),
   NewtonIntegrator(....)
]

If I want to desactive the gravity engine (for example), so I type:

O.engines[3].dead = True

Thank you Anton for your help.

Revision history for this message
jessica sjah (jessica-sjah) said :
#3

I tried to type "O.engines[3].dead = True" and after that the gravity engine is still called? Do you have any suggestion?

Thank you

Revision history for this message
Kneib François (francois-kneib) said :
#4

Hi,

I checked, and setting O.engines["gravityID"].dead = True disables it.
There are two ways to apply the gravity (maybe in your case both are done), so are you sure the gravity applied in your case is not coming from :
NewtonIntegrator(gravity=[0., -9.8., 0.]) ?

Revision history for this message
jessica sjah (jessica-sjah) said :
#5

Hi Kneib,

Yes, you're right. Thank you kneib :)... I verified it and now it works.

Thank you kneib and anton for your reply. It helps me.

Revision history for this message
ceguo (hhh-guo) said :
#7

Hi,

Interesting discussion. I also want to know can I simply rewrite

O.engines=O.engines[:3]+O.engines[4:]

to remove/deactivate the gravity engine?

Ning

Revision history for this message
Christian Jakob (jakob-ifgt) said :
#8

Hi,

One possibility is:

...
O.engines[3].dead = True
...

OR give engine a label, e.g.

...
NewtonIntegrator(gravity=[0.,0.,-10.],label=myLabel)
...

then you can type

...
myLabel.dead=True
...

to deactivate NewtonIntegrator OR

...
myLabel.gravity=[0.,0.,0.]
...

to deactivate gravity.

Hope it helps.

Regards,

Christian.

Revision history for this message
Liqing Jiao (liqing) said :
#9

Propabaly, you may use
O.engines=O.engines[0:3]+O.engines[4:] if you want to delete O.engines[3]. Note, O.engines[3] is the forth one in engines.
Hope it helps.

Cheers, Liqing

At 2013-01-22 14:11:21,"Christian Jakob" <email address hidden> wrote:
>Question #218985 on Yade changed:
>https://answers.launchpad.net/yade/+question/218985
>
>Christian Jakob posted a new comment:
>Hi,
>
>One possibility is:
>
>...
>O.engines[3].dead = True
>...
>
>OR give engine a label, e.g.
>
>...
>NewtonIntegrator(gravity=[0.,0.,-10.],label=myLabel)
>...
>
>then you can type
>
>...
>myLabel.dead=True
>...
>
>to deactivate NewtonIntegrator OR
>
>...
>myLabel.gravity=[0.,0.,0.]
>...
>
>to deactivate gravity.
>
>
>Hope it helps.
>
>Regards,
>
>Christian.
>
>--
>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 : <email address hidden>
>Unsubscribe : https://launchpad.net/~yade-users
>More help : https://help.launchpad.net/ListHelp