Bug fixed in hbond/dreiding/lj

Hi,

I think I have fixed the bug present in switching function. Anyway It will be very pleasure for me, if you go through the changes and confirm it.

Now everything is working fine. { my own system and methanol example}

Please find the modified changes as attachment.

I ran the methanol example in nve and attached TotEng values before and after modification.

Thanks

Karteek Kumar,
Molecular Simulations Lab,

JNCASR, Bangalore, INDIA.

pair_hbond_dreiding_lj.cpp (16.6 KB)

tot_eng_old.agr (29.5 KB)

tot_eng_new.agr (48.9 KB)

I was too lazy to check the formula which Karthik is using in his
code, but I can confirm that the original problem exists (energy
drift), and that Karthik's modification gets rid that problem. (I am
following Karthik's suggestion and using the "dreiding" example in the
examples directory.)

Similar modifications can (need to) be made to
pair_hbond_dreiding_morse.cpp. I'm doing that now and will post the
results today.

Thank you Karthik!

Andrew
My old test system only had one molecule. (I think that's why I did
not notice this problem.)

Similar modifications can (need to) be made to
pair_hbond_dreiding_morse.cpp. I'm doing that now and will post the
results today.

Indeed the problem Karthik discovered effects
"pair_hbond_dreiding_morse.cpp" too. Making these same changes to
pair_hbond_dreiding_morse.cpp fixes energy conservation for that pair
style too.

(See attached test files. The data file for this example is in
"examples/dreiding". I did not try to use realistic parameters for
this test.)

Anyway, that's nifty!
Selfishly speaking, this would have effected my own simulations.
Thank you again Karthik

-Andrew

My old test system only had one molecule. (I think that's why I did
not notice this problem.)

(It was a short polymer with only 4 hydrogen bonds.)

pair_hbond_dreiding_morse.cpp (14 KB)

in.dreiding_morse (2.43 KB)

timesteps_etotal_old.dat (3.1 KB)

timesteps_etotal_new.dat (4.54 KB)

Dear LAMMPS community

Karthik Kumar caught a mistake I made when I tried to put his changes
into pair_hbond_dreiding_morse.cpp. I was sloppy. The corrected
version of "pair_hbond_dreiding_morse.cpp" (and the test results
confirming energy is conserved) are attached.
Thanks for catching this Karthik!

Andrew

pair_hbond_dreiding_morse.cpp (14 KB)

timesteps_etotal_2013-6-10.dat (4.54 KB)

andrew,

i've integrated this and the previous changes into LAMMPS-ICMS so they
won't get lost.

axel.

Posted today in the 24Jun patch … thanks

Steve