git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@9217 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp 2013-01-03 21:07:33 +00:00
parent 0c063777a9
commit 5c4099d126
1 changed files with 13 additions and 0 deletions

View File

@ -225,6 +225,19 @@ void DihedralClass2::compute(int eflag, int vflag)
sinphi = sqrt(1.0 - c*c);
sinphi = MAX(sinphi,SMALL);
// addition by Andrew Jewett, Jan 2013
// adjust the sign of phi if necessary for negative input angles
// n123 = vb2 x vb1
double n123x = vb1y*vb2z - vb1z*vb2y;
double n123y = vb1z*vb2x - vb1x*vb2z;
double n123z = vb1x*vb2y - vb1y*vb2x;
double n123_dot_vb3 = n123x*vb3x + n123y*vb3y + n123z*vb3z;
if (n123_dot_vb3 > 0.0) {
phi = -phi;
sinphi = -sinphi;
}
a11 = -c*sb1*s1;
a22 = sb2 * (2.0*costh13*s12 - c*(s1+s2));
a33 = -c*sb3*s2;