← Back to team overview

yade-users team mailing list archive

Re: Simulation stops unexpectedly

 

Thank you very much, Vaclav, for such expanded answer!
I decided to use the second way (velocity=0) to escape workarounds.



2010/8/12 Václav Šmilauer <eudoxos@xxxxxxxx>

> Hi Anton,
>
> read https://www.yade-dem.org/sphinx/user.html#checkpoints -- although it
> talks about loadTmp, the same applies to O.pause() etc. Calling O.pause()
> from inside the engine will (though it might depend on exact timing between
> python and computation threads, and that is probably the reason why you
> sometimes get the simulation paused and sometimes not) have no effect,
> modifying engines from inside the loop might lead (I would guess) to crash
> and calling O.run() will have no effect either.
>
>
Right, sometimes I had normal exit with multy-starter, and sometimes crash
(very rarely).
I think we should have to have for a future a better mechanism for deleting
engines. I t can be useful in some cases.



> Currently we have no proper method for modifying engines on the fly, from
> inside, although I thought a few times about something like O.postIterHook
> that could be used to postpone python code execution after the current
> iteration (if non-empty); that code could modify O.engines safely.
>
> Now, you can solve your problem with something like:
>
> def feedIsFinished():
>   if condition: O.stopAtIter=O.iter+1 # stop exactly after this
> simulation
>
> O.run()
> O.wait() # will block until the simulation is stopped from inside
> feedIsFinished
> # modify engines here as you want
> O.run() # continue with modified engines sequence
>
> OR, you can set zero translation for the translation engine; deleting the
> bodies is safe without pausing the simulation.
>
> HTH, v.
>
>
> > I pause simulation for a while, delete some engines, delete some bodies
> and
> > then start the simulation again.
> > In this step simulation sometimes terminates, not always, but it
> happens.
> >
> > What do I do wrong?
>
>

References