[lammps-users] Something wrong ? ——pair_lj_cut_coul_long_tip4p.cpp

Hi all

Recently, I read the whole project of " pair_lj_cut_coul_long_tip4p.cpp" .

I am not very sure whether the original code:

// test current rsq against cutoff and compute Coulombic force
if (rsq < cut_coulsq) {

}
cforce = forcecoul * r2inv;
"
should be changed to:

// test current rsq against cutoff and compute Coulombic force
if (rsq < cut_coulsq) {

} else forcecoul=0.0
cforce = forcecoul * r2inv;"

or not.

Thank

Peter

I don't think so. The cforce = forcecoul*r2inv line
is not at the level of if (rsq < cut_coulsq) {.
It's at an inner level where forcecoul is guaranteed
to be set already.

Steve