energy and dump file time step mismatch

lammps developers,

I’m using lammps to generate 10 data points (potential energy, coordinates) for a diamond uniaxial tension case to compare to experimental work. I’ve attached a small sample script.

I noticed that the fix deform command operates on the atoms after the energy/forces are calculated but before the coordinates are dumped. This leads to identical energies for timestep 0 and 1, but updated coordinates in the dump file for timestep 0 and 1. After timestep 0 the potential energies lag behind by 1 timestep.

I see in the manual under fixes that “fixes perform their operations at different stages of the timestep.” Although I didn’t notice anything in the deform manual that indicated when or why it’s invoked where it is in a timestep.

Normally it’s never made a big difference, however in this special situation invoking the deform fix where it currently is in the timestep was unintuitive and took me a while to track down the error. Is there a reason for the deform fix to be invoked where it is now, or is this a bug?

Using rerun on the coordinates generated with the attached script and the dump file it generates gives matching energy/coordinates.

Thanks.

-Ben

Benjamin D. Jensen
PhD Candidate
Department of Mechanical Engineering - Engineering Mechanics
Michigan Technological University
Houghton, MI

in.script (816 Bytes)

There are internal reasons why the deformation needs to be applied between timesteps (i.e. at the
end of the timestep). Fix deform is really designed to be used for
continuous deformations over a many-timestep run.

For what you are trying to do, I suggest a simple loop in the code over 10
iterations. At each iteration you could either do a “run 1” which will re-compute
the energy/thermo at the beginning of each run. Or you could not use
fix deform and use change_box instead (inside the loop), and do “run 0”
each iteration to compute the energy/thermo for a changed box.

Steve

Thanks Steve. That makes sense. I’ll use your suggestion. Every other time I’ve used fix deform it was for a long continuous simulation and it worked great, this is more of a rare/special case.

-Ben

Benjamin D. Jensen
PhD Candidate
Department of Mechanical Engineering - Engineering Mechanics
Michigan Technological University
Houghton, MI