stopAtTime, how does it work?

Asked by rayolau

Hello, I am newbie in Yade, I am trying to stop the simulation at a specific time but O.stopAtTime doesn't work, maybe I am doing something wrong.

The error message is: AttributeError: 'Omega' object has no attribute 'stopAtTime'

It has no sense because on Yade documentation it appears as one of the stop conditions options, do we have to import some library?

Thank you so much,
Laura.

Question information

Language:
English Edit question
Status:
Answered
For:
Yade Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Jérôme Duriez (jduriez) said :
#1

Hi,

Even if we sometimes do not understand them, computers are always right... And indeed this stop function belongs to "Scene" class, and not to "Omega" class (and the python/yade object "O" is an instance of Omega..) (see https://www.yade-dem.org/doc/yade.wrapper.html). Omega and Scene are different since Omega object can include different Scene objects.

So now, I hope you understand where does your problem come from. To solve it, you should wait for another answer : I could not find how to access with Python the current Scene of "O"...

Jérôme

Revision history for this message
Jan Stránský (honzik) said :
#2

Hello,

@Jerome: you are right that Omega and Scene are different objects, but FYI
most of Scene attributes can be accessed in python through O.something
syntax. So in Python, O (instance of Omega) most of the time represents its
current Scene (O.bodies, O.interactions etc.). For more information, have a
look at yade/py/wrapper/yadeWrapper.cpp, line 862 ("_sceneObj" function) or
the file in general.

@Laura: should be now available in git latest version. If you do not want
to do the update, use this temporary workoround:
O._sceneObj().stopAtTime = whatever

For others, using _sceneObj really should be considered as workaround, not
as standard approach (at least according to current documentation).

cheers
Jan

2014-03-31 13:26 GMT+02:00 jduriez <email address hidden>:

> Question #246284 on Yade changed:
> https://answers.launchpad.net/yade/+question/246284
>
> Status: Open => Answered
>
> jduriez proposed the following answer:
> Hi,
>
> Even if we sometimes do not understand them, computers are always
> right... And indeed this stop function belongs to "Scene" class, and not
> to "Omega" class (and the python/yade object "O" is an instance of
> Omega..) (see https://www.yade-dem.org/doc/yade.wrapper.html). Omega and
> Scene are different since Omega object can include different Scene
> objects.
>
> So now, I hope you understand where does your problem come from. To
> solve it, you should wait for another answer : I could not find how to
> access with Python the current Scene of "O"...
>
> Jérôme
>
> --
> 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 : <email address hidden>
> Unsubscribe : https://launchpad.net/~yade-users
> More help : https://help.launchpad.net/ListHelp
>

Can you help with this problem?

Provide an answer of your own, or ask rayolau for more information if necessary.

To post a message you must log in.