dihedral_style table bugfix (patch)

The latest patch fixes two significant bugs with dihedral_style table.

1) dihedral_style table no longer causes MPI to freeze up. (I am very
sorry about that!)

2) dihedral_style table now obeys the sign convention for dihedral
angles shown here:

http://www.structuralbioinformatics.com/chapter7.shtml
http://kinemage.biochem.duke.edu/teaching/anatax/html/anatax.1b.html
http://www.pumma.nl/index.php/Theory/Potentials#Dihedral
http://galilei.chem.psu.edu/~bjg/Chem560_2003/Potentials/OPLS_1996.pdf
http://cscweb.kist.re.kr/code/DL_POLY/manual/REFERENCE_2.0.pdf

Aside from being very inconvenient, neither of these bugs invalidates
any results you may have calculated using earlier verions of this code
(assuming you were able to get it to run at all). However this code
change means that if you continue an old simulation using the new
code, your molecules will suddenly reverse chirality. If you have any
old simulation data that you want to continue running, either keep the
old code, or email me and I'll send you a version of the newest
dihedral code using the old angle sign convention. I apologize for
difficulties you probably have had getting dihedral_table to work in
the past. It's getting better.

Thanks to Thomas Rosch for discovering and reporting the bugs. Keep
those reports coming.

Andrew

dihedral_table.h (10.8 KB)

dihedral_table.cpp (42.9 KB)

andrew,

just included your bugfix into LAMMPS-ICMS.
please note that the dihedral_table.cpp still
contains two unprotected debug printfs. of course,
i removed them, before committing to the SCM.

cheers,
    axel.

please note that the dihedral_table.cpp still
contains two unprotected debug printfs. of course,
i removed them, before committing to the SCM.
Axel

It's true! Thank you.
(Reposting the same code with the aforementioned printfs Axel removed.)
Keep those bug reports coming!

Andrew

dihedral_table.cpp (42.8 KB)

dihedral_table.h (10.8 KB)

this will be in the next patch, today ...

Thanks,
Steve