← Back to team overview

yade-users team mailing list archive

Re: [Question #703920]: How to excute the VTKRecorder at virtual time

 

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

    Status: Open => Answered

Jan Stránský proposed the following answer:
Hello,

> realPeriod
> virtPeriod

the third is iterPeriod, just to make it complete

> If I want to call the VTKRecorder at a specific virutal time , I
should set the initRun =true?

no.
initRun determines what to do if time=0, call the engine or not?

> How can I manage to do that?

See MWE below. Replace "thatEngine" by your VTKRecorder.
###
O.engines = [
    PyRunner(virtPeriod=20,command="startThatEngine()",label="thisEngine"),
    PyRunner(dead=True,virtPeriod=3,nDo=5,command="print(O.time)",label="thatEngine"),
]

def startThatEngine():
    thisEngine.dead = True
    thatEngine.dead = False

O.dt = 1
O.run(100,True)
###

Cheers
Jan

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.