yade-users team mailing list archive
Mailing list archive
Re: R: [Fwd: Re: Saving/Reloadind]
> One question: say that I reload a triaxial and then I change with python a
> value of a particular parameter inside an engine, and say that this variable
> would influence only the triaxial phase (say epsilonMax). Well, since all the
> engines are run at each iteration, what actually happens? I mean, the
> simulation starts again from which point exactly?
> Sorry, probably I haven't got how to set up "checkpoints".
Saving/loading always saves/restores the simulation completely (or
should), including bodies and engines; therefore if you change anything
and reload later, those changes will be lost. (I used the colloquial
"checkpoint" expression in the sense giving name to the point where you
saved the simulation, nothing more.)
> If I use in c++ something like Omega::instance().stopSimulationLoop(), I know
> where I stop the simulation but what if I want to reload it and carry forward?
> What in c++, I mean.
In c++, be _very_ careful to not load simulation from inside engine,
that will most likely hang, crash or behave wrong. See
examples/concrete/uniax.py: stopIfDamaged is called from within engine,
therefore if I want to stop&reload (the initTest func) the simulation, I
have to run initTest in different thread, otherwise we would be waiting
for that step to finish, which would never happen actually. It took me a
while to understand this actually.
Once you stop simulation inside an engine in c++, there is no simple way
to continue, since the loop will just stop at the end of the step and
control will not be given to your engine again. Python is your friend.