Problem using compute temp/deform

Hi LAMMPS users,

I have a triclinic box that deforms with constant shear stress using NPT integrator. As far as I understand, the temperature compute have to be redefined so that the velocity bias is temporarily removed in order to compute only the thermal component of the kinetic energy. To do that I incorporate:

compute defTemp all temp/deform

to the code and add a fix_modify to the original fix like this:

fix 1 all npt temp 100 100 0.2 tri 1 1 1 drag 1 yz 5000 5000 1
fix_modify 1 temp defTemp

I would expect the computed temperature each output line to be different from the temperature computed before that change. I also included in the thermo output the compute like this:

thermo 100
thermo_style custom step c_defTemp

By now you probably suspect that I get the exactly same temperatures before and after the change of defaults.
You’re correct.

So, where did I go wrong?

thank you,


The doc page could be more clear, but compute temp/deform works with
a fix deform command. That command set a deformation rate
for the box which compute temp/deform uses to infer the streaming
velocity of the atoms. Fix npt (even if you apply a shear stress) does
not set a deformation rate, hence compute temp/deform sees
the streaming rate as 0.0 and computes the same as compute temp.

I'll add an WARNING to compute temp/deform if no fix deform is
defined. Conceptually, I doubt that fix npt is inducing a significant
streaming velocity (otherwise your applied shear stress is far too big).

A more typical way to setup this kind of model is to use fix
deform to shear at a steady rate, then use fix npt (if needed) to
equilibrate the non-shearing dimensions (e.g. x or y, but not xy).


Just saw that compute temp/deform already has this warning:

                   "Using compute temp/deform with no fix deform defined");

Did you get it during your run?


Hi Steve,

You right, and I did get this warning.