← Back to team overview

yade-users team mailing list archive

Re: Storing variables with python

 

2010/7/20 Václav Šmilauer <eudoxos@xxxxxxxx>

>
> > Exactly! Thanks for suggestions! I will do as you say. Chiara
> I though of a simpler way now:
>
> O.engines=[
>        PeriodicPythonRunner(command='addPlotData',label='myRecorder') # do
> not specify any periods, the engine will be therefore inactive
> ]
>
> def addPlotData:
>        if myRecorder.iterPeriod==0:          # this is the default initial
> value
>                if chiaraCondition: myRecorder.iterPeriod=100 # or other
> number
>                else: return
>        plot.addData(...)
>
> HTH, Vaclav
>
Hi,
if iterPeriod is equal to zero, then the engine is not going to be run and
so the function addPlotData (just tried, hope it is expected). But setting a
positive iterPeriod and using the loop above (where this time
myRecorder.iterPeriod==a_pos_value) it works well the same!
Chiara


>
>
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-users<https://launchpad.net/%7Eyade-users>
> Post to     : yade-users@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~yade-users<https://launchpad.net/%7Eyade-users>
> More help   : https://help.launchpad.net/ListHelp
>

Follow ups

References