← Back to team overview

yade-users team mailing list archive

Re: [Question #166809]: remove functions from PyRunner

 

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

    Status: Open => Answered

Chiara Modenese proposed the following answer:
We added some time ago a useful feature which would solve your problem. If
you add a label to the engine you want to eliminate from the simulation
(e.g. PyRunner(iterPeriod=10,command='calm()',label='MyEngine')), then you
can say:
MyEngine.dead=True
It practically means that since next iteration that engine will not be
active any longer.

HTH,
Chiara

On 3 August 2011 12:41, Christian Jakob <
question166809@xxxxxxxxxxxxxxxxxxxxx> wrote:

> New question #166809 on Yade:
> https://answers.launchpad.net/yade/+question/166809
>
> Hi,
>
> For generation process of my model I create some spheres randomly. Then the
> model has to calm, because there are some overlaps. So I wrote a small
> function:
>
> def calm():
>        for ii in range(0,sum_spheres+1):
>                O.bodies[ii].state.vel=Vector3(0,0,0)
>
> I can add this function to O.engines with the PyRunner command:
>
> O.engines=O.engines+[PyRunner(iterPeriod=10,command='calm()')]
> O.run(1000,True)
>
> My question is:
>
> How can I remove this function? I need it only on the first few steps in my
> model.
> I tried...
>
> O.engines=O.engines-[PyRunner(iterPeriod=10,command='calm()')]
>
> ...but it doesnt work.
>
> 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     : 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.