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]) {
force->pair->single(i,j,itype,jtype,rsq,factor_coul,factor_lj,1,one);
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?
Thanks,
-Taner
Original post: