yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #16224
Re: [Question #660533]: dynamic change of gravity vector
Question #660533 on Yade changed:
https://answers.launchpad.net/yade/+question/660533
Jérôme Duriez posted a new comment:
Hello,
For sake of educational purposes, it's maybe worth to emphasize there
was plenty of reasons for your initial script to "do nothing"
- your PyRunner was supposed to execute some "gravity()" Python function, however none was defined. You just defined a "graviy()" function (without "t"). Actually I'm expecting this code to throw an error instead of doing nothing...
- what you wanted is to modify the gravity attribute of the NewtonIntegrator engine instance which was in your O.engines. This was not possible with your commands (see below)
- with gravity=a in the NewtonIntegrator() line of your O.engines definition, you affect the current value of "a" to the gravity attribute, through a "passing by value", not a "passing by reference".
Subsequent changes to a's value will not be reflected in O.engines[3].gravity...
- you're mixing Python tuples (the type of "a") and Vector3r (i.e. 3 real vectors, the type of NewtonIntegrator.gravity). You can thank YADE developers for this to be gracefully handled here (things here work as intended by the user), but I doubt you will always be that lucky in your future YADE-ing ;-)
Jerome
--
You received this question notification because your team yade-users is
an answer contact for Yade.