Doing minimization while running the simulation

I want to do minimization while running the simulation.

I want to run total 100000 steps. While running 1000000 steps, I want to do energy minimization every 400 steps. I wrote a script like this


label loop
run ${prdSteps}
if “step%400 == 0” then &
minimize 1e-4 1e-5 10000 100000 &
min_style fire &

dump        dDump all custom ${dumpFreq} prd.lammpstrj id x y z &
dump_modify dDump sort id pbc no

This script runs without error, but I am not sure it does energy minimization every 400 steps.

Any comments and advices are welcome!

With regards

Please check the official documentation for the run command, especially the every keyword. What you are doing now will run through the entire number of steps you have specified, and then do one minimisation right at the end.

Thank you, sir. I have checked the “run” command in the online manual. Can you check whether I understood it properly or not?

To minimize every 400 steps during 400000 steps, I should write command like

run 400000 every 400 “minimize 1e-4 1e-5 10000 100000” “min_style fire” “dump …”

Is it good to go, sir?

With regards

I don’t often do something like that in my own scripts so I don’t know just from looking if it is the correct syntax. But if you try it you should be able to see if it works or not. :slight_smile: