Mistake in virial calculation for improper_umbrella

By comparing with our own code I noticed an error in the calculation of
the virial contribution for the improper_umbrella potential.

In the file improper.cpp, in the function 'ev_tally' the vectors vb1,
vb2 and vb3 should be equal to (r1-r2), (r3-r2) and (r4-r3) respectively.
However in the file MOLECULE/improper_umbrella.cpp the 'ev_tally'
function is called with those arguments set to (r2-r1), (r3-r1) and
(r4-r1), see lines 85-101.

Can someone confirm that this is wrong? The problem is easy to fix: vb1,
vb2 and vb3 should be redefined correctly just before 'ev_tally' is
called in MOLECULE/improper_umbrella.cpp. For the other improper styles
everything seems to be fine.

I am using the latest (as of time of writing) github master branch of

thanks for reporting. i've added this to the LAMMPS issue tracker on
github as issue #182: