← Back to team overview

yade-users team mailing list archive

[Question #690856]: can't get O.stopAtTime to work

 

New question #690856 on Yade:
https://answers.launchpad.net/yade/+question/690856

I am having trouble getting O.stopAtTime to work.  I tried this little script.  From my understanding, this would run until either 400 iterations, or 20 seconds, whichever comes first.  Actual result, runs for 400 iterations = 320 seconds.   Went way past the intended stop time.

O.stopAtTime = 20.0
O.stopAtIter = 400
O.run(-1, True)
print(O.time)
print(O.iter)

So maybe it's not whichever comes first, it's whichever comes last.  So then I tried this

O.stopAtTime = 20.0
O.stopAtIter = 4
O.run(-1, True)
print(O.time)
print(O.iter)

That runs for 4 iterations = 3.2 seconds.  So it appears to be always using the value of O.stopAtIter, and O.stopAtTime is ignored.  So then let's try this:

O.stopAtTime = 20.0
O.run(-1, True)
print(O.time)
print(O.iter)

This runs forever. 

I found this thread from 2014:  https://answers.launchpad.net/yade/+question/246284 but the syntax suggested there O._sceneObj().stopAtTime no longer works.

Running single threaded job with a recent daily build (Yade 20200511-3819~5bf8512~buster1)

As a workaround, I can definitely put in a little PyRunner to periodically check O.time and pause when it hits a certain value, but it seems like that shouldn't be necessary.

What am I missing?  

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