[lammps-users] A problem when using thermo command along with minimize command

Dear LAMMPS Users,

   I encountered a problem when using thermo command along with minimize command (16 Nov 2007 version).

Part of my input file:
............
thermo_style custom step temp pe pyy
thermo 0
minimize 1.0e-15 1000 10000
variable nstep loop 2
label flag1
displace_atoms upper move 0 0.25 0 units box
displace_atoms lower move 0 -0.25 0 units box
minimize 1.0e-12 1000 10000

Part of the log file:
Step Temp PotEng Pyy
       0 0 -351.9879 379058.07
     110 0 -407.22677 319111.03
Step Temp PotEng Pyy
     110 0 -406.161 -9133.7696
     156 0 -407.1235 -9133.7696
Step Temp PotEng Pyy
     156 0 -405.91845 -20777.499
     202 0 -406.82404 -20777.499

   The value of thermo command argument is seted as zero to output thermo message only in the end of each circulation step, but it is obvious that the value of Pyy is wrong. When I change "thermo 0" to "thermo 1", I got the right result:

Step Temp PotEng Pyy
       0 0 -351.9879 379058.07
     ...........
     110 0 -407.22677 35.198799
Step Temp PotEng Pyy
     110 0 -406.161 -9133.7696
     ...........
     156 0 -407.1235 -12235.351
Step Temp PotEng Pyy
     156 0 -405.91845 -20777.499
     ...........
     202 0 -406.82404 -23544.342

   I think there is an error. Can you fix it?
   Thank you in advance for your time and help.
   
                            With best regards,

                               Zhenhai Xu

                 School of Materials Science and Engineering
                 Harbin Institute of Technology
                 Harbin, Hei Longjiang Province, P.R. China

Can you post an input script and data file (if needed) for
a small problem that illustrates this?

Steve

This was a bug with the minimizer not triggering the virial calculation
on its last iteration. Just posted a patch for it.

Thanks,
Steve