do minimization and dump something every N steps

Dear LAMMPS users,

I want to run a simulation of about several 10^7 time steps. I would like to

  1. do a minimization every 1000 steps for example.
  2. after each minimization, dump the min pe and xyz coordinates to a file.
    just write a restart file every 1000 steps, then write another script to loop over these restart files to perform minimization one by one.

whichever is easier.

Generally what would be an efficient way to do this? The doc of minimize, dump and write_restart doesn’t suggest much on this. What command(s) can serve such purpose? Thank you for any suggestion.



so you want to run for 1000 steps getting config c_1000 then you want to minimize that getting c_1000_min and then you want to continue the run from c_1000 right?

If thats what you want to do (in contrast to continueing the run from the minimized state c_1000_min). I guess it might be more efficient to run first the whole simulation writing restart files every 1000 steps (which the write_restart command allows), and then use a script to launch 10^5 minimization runs :-D.

If you are a bit more adventurous you might try to modfiy the fix store/state to allow it to restore a state. But you will have some issues with the intermediate minimizes, and might need to use some fancy timestep redefinition (at which timestep you currently are).


-------- Original-Nachricht --------

Hi Christian,

Thank you for the suggestions. Yes, I want the run to continue without interruption, each minimization is based on a snapshot and the resulting c_1000_min is for information purpose only, at the moment. I think I go with writing restart files. I just noticed the “restart” command, allowing to specify every how many steps a restart file is written. It seems “write_restart” command doesn’t specify that.

What if I want to interrupt the run, do minimize, then contine the run from the c_1000_min config ? In such case what would be the best way to do it? Thanks again.


Put the run 1000, minimize, write_restart commands in a loop.
See the jump and next command doc pages for examples.