"compute pair lj/cut/coul/long ecoul" does not add to total energy

Hello,

I was trying to break apart the total energy of my system using the compute pair command. Specifically, I have:

compute 2 all pair lj/cut/coul/long ecoul
compute 3 all pair lj/cut/coul/long evdwl
compute 4 all pe

and the corresponding output is attached below. I was expecting the ecoul and evdwl to add to the total potential energy but they do not. I was able to verify (with my own MD code) that the evdwl part matches the LJ contribution to the energy and that the correct coulombic contribution should be around -22000 (from a separate Ewald & PME code). Is this behavior expected? Can the compute pair not handle long range interactions? The -9800 value in the file below is suspiciously close to the real space contribution in my PME code (I know LAMMPS uses P3M).

energy_breakdown.txt (795 Bytes)

Long-range interactions are not computed by a pair style and thus not tallied into ecoul (or evdwl).
You could access them with:

variable elong equal elong

And then use v_elong alongside c_2, c_3, and c_4

2 Likes