TIP4P coulomb cutoff implementation issue

Hi (questions for devs)

while implementing the TIP4P lj/cut/long/coul version for the USER-CUDA package I stumbled over a small oddity. In order for the coulomb interaction between two particles (one of which being oxygen) to be calculated, both the modified and the unmodified "rsq" have to be smaller than the cutoff. I noticed that because in my implmentation I only checked the modified rsq against the coulomb cutoff to determine whether to calculate the interaction.

Since the modification is relatively small the differences are minimal but still I found that behaviour a bit odd. I would expect that one only checks against one of the two distances.

What do you think is the best way to proceed? Change the behaviour in the original tip4p, check against both cutoffs in my implementation as well, or live with some small deviations.

Cheers
Christian

You're talking about the initial check of rsq vs cutsq[][] and then
the later check against cut_coulsq? I suppose this could
lead to an inconsistent decision about what is inside the cutoff.
Need to think about it a bit more. I think what is probably
better is to use the modified rsq for the Coul check
and the original rsq for the LJ check.

Steve

Hi Steve

yes thats exactly what I am talking about. In my code I did only the two seperate checks (using the modified rsq for coulomb check) without the initial one. That lead to some discrepancies.

Cheers
Christian

-------- Original-Nachricht --------

Just posted a 28Feb patch for this. See if you
think it is now consistent with what you want to do in USER-CUDA.

Axel - this probably also affects the OMP version of the TIP4P potential.

Steve

Just posted a 28Feb patch for this. See if you
think it is now consistent with what you want to do in USER-CUDA.

Axel - this probably also affects the OMP version of the TIP4P potential.

...and the OPT version. :wink:

will check it out tomorrow after i'm done teaching.

axel.

steve,

quick feedback. qdist doesn't seem to be properly initialized.

axel.

git diff KSPACE/pair_lj_cut_coul_long.cpp
diff --git a/src/KSPACE/pair_lj_cut_coul_long.cpp
b/src/KSPACE/pair_lj_cut_coul_long.cpp
index 4f78f99..927b003 100644
--- a/src/KSPACE/pair_lj_cut_coul_long.cpp
+++ b/src/KSPACE/pair_lj_cut_coul_long.cpp
@@ -51,6 +51,7 @@ PairLJCutCoulLong::PairLJCutCoulLong(LAMMPS *lmp) : Pair(lmp)
{
   respa_enable = 1;
   ftable = NULL;
+ qdist = 0.0;
}

/* ---------------------------------------------------------------------- */