Restarting simulations with fix deform

Dear Lammps users,

I am contacting you because I have problems restarting simulations under uniaxial deformation. I am considering a polymer network where bending interactions are also included. Then, I apply uniaxial deformation considering that the volume is constant, i.e.,

fix 3 all deform 1 y volume z volume x erate 1e-5 units box remap x

I want to continuos my simulation from the last restart. Then, I read the file and apply the fix deform with the same erate. However, I realized that the stress increased faster than the value I expected.

From the manual, I read that the tensile strain is defined as a function of the original box length L0. Then, I tried to rescale the erate by considering that new_erate=(L0/Lt)*old_erate. However, this approach is not working because the stress is still increasing faster than the value I expect. In addition, the deformation is now so slow that I would extend the simulation time one order of magnitude more.

Is it possible to define “L0” in Lammps? In that case, the tensile strain would be the same. Or someone could have a better strategy.

Thank you so much in advance for your time.

Regards,
Jose

1 Like

Please have a look at the “start / stop” keywords for the run command

Fix deform will by default assume that the entire deformation is done during a single run and adjust its settings for what is the state at the beginning and what should it be at the end from the number of the steps (essentially, if you have run <Nsteps> this is equivalent to run <Nsteps> start <CurrentStep> stop <CurrentStep+Nsteps>. But if you want to distribute your deformation over multiple runs, or want to continue an interrupted run, you would have to make certain that the settings are consistent across the multiple runs. Thus it is usually advantageous to first do a reset_timestep 0 and then start your simulation with deformation. Then each restart could use the start 0 option to have fix deform properly determine for how far along the deformation you are.

Alternatively, you can calculate the box length desired at the end of the run and use the final keyword for fix deform :slight_smile:

Dear Axel,

Thank you so much for your answer. Just to be sure, If I want to deform my polymer network during 1e8 steps, I can divide the fix deform by 8 run commands:

run 1e7 start 0 to 1e7
run 1e7 start 0 to 1e7

run 1e7 start 0 to 1e7

I do not understand from the manual why the number of steps in the ‘run’ differs from the number of steps in the ‘stop’, i.e., run 1000 start 0 stop 10000

Jose.

Thank you so much Michael. I will also try your strategy!

No, you would want

run 1e7 start 0 stop 1e8
run 1e7 start 0 stop 1e8
...
run 1e7 start 0 stop 1e8

This indicates that the short run of 1e7 is part of a larger run from 0 to 1e8, which lets fixes such as fix deform know the start and end of the larger run.
Although, I can’t remember if LAMMPS allows 1e8 exponential notation for integers, you may need to write out all the 0’s…

No, it does not.

But there is a possible workaround “hack”. run $(1e8) should work. Variable expressions are evaluated as floating point and then formatted with printf("%.15g"), so anything up to 1e14 should be converted to an integer.

1 Like

Thank you so much, Michael and Alex, for your time and help!

All the best,
Jose

Dear Lammps users,

Unfortunately, I am returning to this topic because I still have the same problem. I have followed the suggestion to split the simulations into different run start/stop. In particular, I have considered a loop with 17 run start/stop defined as:

run 5e7 start 0 stop 8e8

Then, when the HCP where I am running the simulations stop them, I take the restart file generated at the end of the last start/stop that finished. In addition, I restart the new simulation doing restart_time 0, as well as I keep the parameters relative to start/stop, as well as the erate fixed. However, the stress builds up faster than I expected, and I cannot figure out what step I am taking wrong.

Thank you so much again for your help.

Regards,
Jose

If you mean reset_timestep 0, then that’s incorrect, as the simulation will never reach timestep 8e8. The read_restart command is designed to pick up exactly where the previous simulation left off, including the timestep.

Is the box length changing as expected? That should be your first focus for whether your simulation is working correctly.

Hi Michael,

I repeated the simulations without reset_timestep 0 (sorry for the previous spelling mistake) and checked stress and strain. As you can see in the figure I attach, the red curve in both plots corresponds to the simulation starting from a restart file. The strain curve shows a smaller slope, and the stress increases faster (it should follow the same trend that the black curve).

Regards,
Jose

Deformation.pdf (29.9 KB)

If you don’t want to share your input script, I suggest you strip it from everything but fix deform and see if it restarts properly. There are multiple things that can introduce this behaviour. BTW, you definition of \lambda is wrong on the left graph. You used the box length from the restart file as L0 while you should have used the initial one.

This syntax should create an error unless you have a very old version of LAMMPS, then it would be interpreted as:

run 5 start 0 stop 8