← Back to team overview

yade-users team mailing list archive

Re: Engines Python

 

> is it possible to call an engine inside another engine in python? For
> instance, can I use PeriodicPythonRunner to define a function that
having
> satisfied a certain condition (say after tot iterations) call an engine
> (say
> apply a force)?
Hi Chiara, engines are callable objects (define the __call__ method), so
you can call them with (): 

forceEngine=ForceEngine(...)
forceEngine()
# ForceEngine(...)() would also work

You can make the forceEngine a variable so that the engine is not
constructed every time.

Cheers, Vaclav



Follow ups

References