[lammps-users] patch: energy option for fix temp/berendsen

Hi all,

Most of the thermostat fixes in LAMMPS compute a global scalar showing
the cumulative energy change due to the thermostat. The temp/berendsen
fix didn't. Attached is a patch for fix_temp_berendsen.{cpp,h} that
should now allow this.

Basically, all I did was lift apparently relevant code from
fix_temp_rescale.* and put it in fix_temp_berendsen.*. Because rescale
and berendsen both do simple velocity scaling, albeit with different
scale factors, the modification was relatively simple. Naturally, this
all comes without warranty, but if I've overlooked something obvious,
feel free to reply sarcastically.

Also attached is a simple input script for playing around with the new
berendsen energy option, with or without biasing for drift velocity.


Craig - I posted a 15 Sept patch with this upgrade.