in order to check a calculation of the heat flux J = d M / dt where M = \sum_a x_a e_a and e_a is the total energy at atom a and x_a the position at atom a I've run into something I can't figure out. The heat flux J and the time derivative of the moment M using a finite difference from one timestep to the next (for a very small timestep) is consistent for a non-periodic system. However, with a periodic system there is no agreement.
I've tried a number of things:
* translate the box: the results are invariant
* check that atom indices/labels at one timestep match those at the next : true for the system I am testing with
* change the system size : some times the errors are better than others
* "unwrapped" the coordinates using the function at the end of the email : no correspondence
* split the moment calculation into J = \sum v_a e_a + x_a (d e_a / dt) : the problem is in the energy rate term
none of these turned up what is going amiss. Any insight would be appreciated.
btw I am using "atom_style dpd"