[lammps-users] dumping pairwise energy

Dear list,

I am following up on a previously posted (2005-11-30) problem in dumping
per atom pair-wise energy. I also have the same problem (original post
pasted below) when dumping the energy using a command such as:

dump 1 all custom 100 test tag eng

Basically the energy comes out to be zero for all atoms.

I noticed that interestingly the problem occurs when pair_style
lj/cut/coul/long is chosen. When lj/cut/coul/cut is used the energy is
correctly dumped.

I looked into the code where this dump is calculated (fix_energy.cpp).
As far as I was able to follow, up to the if statement in line 148
everything seems fine.

fix_energy.cpp,lines 148-153:
      if (rsq < cutsq[itype][jtype]) {
  e = one.eng_coul + one.eng_vdwl;
  energy[i] += e;
  energy[j] += e;

But "one.eng_vdwl" and "one.eng_coul" come out to be zero after the
"single" function call. I thought the problem could be in this function
which should be in pair_lj_cut_coul_long.cpp for the pair_style
lj/cut/coul/long. Yet this function appears to return non-zero values
for both eng_vdwl and eng_coul. It seems to me that there is something
funny going on when the function is called (line 149) and the energies
are assigned (line 150).

Is there anyone who can help me to figure this out?


Original post:

Are you using the most current version of LAMMPS (fully patched)?
If not, see if you still have the problem with the newest version.
If you do, email me your input script and data file for a small
problem and I'll take a look. I don't know of any bug related
to this issue, but I'd want to check with the current version.


Steve, you were right.
After installing the current version the problem was resolved.

Thanks a bunch,