Hi Lammps users & developers,
I want to compute the instantaneous internal virial W from a trajectory for which I have dumped the atoms positions and forces, r_i and f_i for each frame.
I computed the internal virial by W = -1/3 * sum_i r_i . f_i
and knowing that pV = NRT + W , i checked whether i got the right result, as I also have p, V, N and T.
But I do not obtain the same . I have done the simulations in the NVE ensemble with periodic boundary conditions. I tried molecular systems first, and finally restore to a simple atomistic LJ and the results are still not the same.
First I thought it may be an issue of using in-cell vs uncorrected (real) coordinates, but no option gives the right result.
Any feedback on what may be wrong in my calculations and how to obtain the internal virial from a lammps simulation will be appreciated,