restarts + fix deform

Hi Everyone,

I have been having problems with fix deform in simulations where
I repeatedly continue the simulation from a restart file.

The documentation states "This fix can perform deformation
over multiple runs, using the /start/ and /stop/ keywords of the run <http://lammps.sandia.gov/doc/run.html> command."

In fact, since the initial undeformed box is not saved by the fix to
the restart file, each time the simulation is restarted fix deform
takes the current (deformed) box as the initial box. This gives
wrong results, e.g. for constant engineering strain simulations.

One fix would be to allow the user to specify the undeformed
box when defining the deform fix, which I have implemented if
you are interested.

Hi Everyone,

I have been having problems with fix deform in simulations where
I repeatedly continue the simulation from a restart file.

The documentation states "This fix can perform deformation
over multiple runs, using the /start/ and /stop/ keywords of the run
<http://lammps.sandia.gov/doc/run.html> command."

this sounds a lot like you are misunderstanding this sentence.
"multiple runs" in this context means: multiple run commands in the
same file. it does *not* refer to restarts directly. by default, fix
deform will do a gradual deformation over the number of steps given as
the argument to "run". however, sometimes this is not desired, but
rather the deformation should be extended beyond a single run command.
then with the start/stop options options you can tell fix deform what
the ultimate final step is going to be and well as what step from the
total number of steps you are starting from. i.e. the following would
be the same.

run 400

run 100 stop 400
run 100 start 100 stop 400
run 100 start 200 stop 400
run 100 start 300 stop 400

of course, you can break this down into separate inputs and do a
write_restart at the end and a read_restart at the beginning of each
segment.

In fact, since the initial undeformed box is not saved by the fix to
the restart file, each time the simulation is restarted fix deform
takes the current (deformed) box as the initial box. This gives
wrong results, e.g. for constant engineering strain simulations.

One fix would be to allow the user to specify the undeformed
box when defining the deform fix, which I have implemented if
you are interested.

why not just use the change_box command to reset the box to the
desired dimensions before doing your run?

axel.

Hi Axel and Everyone,

Thanks for fast response!

this sounds a lot like you are misunderstanding this sentence.
"multiple runs" in this context means: multiple run commands in the
same file. it does *not* refer to restarts directly.

Indeed. My problem is that I need to break down a deformation
into multiple subsequent simulations due to max time my job
can run on the queue. Btw. I'm stretching ~5M bead large
Kremer-Grest polymer melts and networks until the FENE bonds
start breaking.

run 400

run 100 stop 400
run 100 start 100 stop 400
run 100 start 200 stop 400
run 100 start 300 stop 400

of course, you can break this down into separate inputs and do a
write_restart at the end and a read_restart at the beginning of each
segment.

4X "run 100 start 0 stop 400", but I agree, you wil get the same result.

Now instead try for the sake of the argument

run 100 start 0 stop 400
unfix def
fix def all deform ...

run 100 start 0 stop 400
unfix def
fix def all deform ...

and so on, where the deform arguments are the same.

And you will get a very different result, in fact if you specify a constant engineering strain
rate you will get a constant true strain rate, since each new fix def will use the instantaneous
box, not the initial undeformed box as reference. The problem is the same when I am
restarting my simulation multiple times to continue the deformation.

Which is why the simplest solution is to allow the user to specify the initial box
shape to fix deform, since this information needs to be propagated from one
simulation to the next in some form. Alternatively, the user has to keep track
of e.g. renormalizing strain rates in the correct way when restarting the simulation.
I don't get the idea of using change_box since the current box shape is the
result of the strain history of the simulation, I don't want to change that.

Axel is correct on what the doc page means for fix deform. I.e.
no info about the fix is stored in a restart file. However if you
do multiple run commands in one script you can treat the
deformation as if it were happening over the equivalent single
long run, via the run start/stop keywords. I think this is only relevant to some of the styles,
e.g. “final” and “delta” where the deformation ends up at
a certain value at the end of the last run.

The reasoning for not storing info in the restart file was
we thought the user could simply re-specify a fix deform command
with appropriate values in the restart script and get contiguous
behavior. I think you
are saying that is not possible for “erate” b/c the command
needs to know the initial box dimensions, to perform the
deformation consistently across multiple runs (in one script
or in a restart script)? In that case, I agree with you that
we should add an option to specify the initial box state.

My recollection is that erate was added as an option afterwards. Is it the
only deform option that does not work via the multiple run or restart
logic I described above?

Steve

Dear Everybody,

The reasoning for not storing info in the restart file was
we thought the user could simply re-specify a fix deform command
with appropriate values in the restart script and get contiguous
behavior.

It appears to fail for all deformation styles.

To check, I ran an uniaxial deformation remap x with each deformation style
printing out the box size at each time step doing either
1) fix deform followed by run 100
2) fix deform followed by 5x run 20 start 0 stop 100 interleaved with unfix deform
and redefine fix deform
3) as 2 where I have modified fix deform code and specify the unstrained domain limits.

As expected the deformation path for 1 and 3 match for all styles, but for 2 the
deformation path consistently differ.

  I think you
are saying that is not possible for "erate" b/c the command
needs to know the initial box dimensions, to perform the
deformation consistently across multiple runs (in one script
or in a restart script)?

Indeed.