Resetting and starting simulations from the beginning
Hello,
I would like to ask that if there is a way to run simulations like batch mode but without using the actual batch mode function.
In more details:
1. I would like to run a simulation which will stop at a given time.
2. Then I would like to save a data.
3. After, I would like to reload/reset the simulation and change one thing (ie. density of a particle).
4. Then run the simulation again and save the same data.
I have created an MWE using the bouncing sphere example. In this example, I don't change any parameter. I just run the simulation for 1 sec, then I print the number of the current run, then reset and start again.
My problem is that the simulation won't reload and won't start automatically again. I have tried O.loadTmp() instead of O.reload() but had no success.
-------
O.bodies.append(
[
# fixed: particle's position in space will not change (support)
# this particles is free, subject to dynamics
]
)
O.engines = [
),
# Apply gravity force to particles. damping: numerical dissipation of energy.
]
O.dt = .5e-4 * PWaveTimeStep()
index=0
def stop():
global index
if O.time>1:
O.reload()
#O.loadTmp()
O.run()
# save the simulation, so that it can be reloaded later, for experimentation
O.saveTmp()
O.run()
-----------End of MWE----------
Thank you in advance for your help !
D
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Jan Stránský
- Solved:
- Last query:
- Last reply: