Unverified Commit 9e2129b6 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer Committed by GitHub
Browse files

Merge pull request #1767 from LucienPan0903/p_class2

Patch of class2 dihedral
parents 90729ebe 599a1895
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -182,6 +182,11 @@ void DihedralClass2::compute(int eflag, int vflag)
    costh13 = c0;
    costh23 = (vb2xm*vb3x + vb2ym*vb3y + vb2zm*vb3z) * r12c2;

    costh12 = MAX(MIN(costh12, 1.0), -1.0);
    costh13 = MAX(MIN(costh13, 1.0), -1.0);
    costh23 = MAX(MIN(costh23, 1.0), -1.0);
    c0 = costh13;

    // cos and sin of 2 angles and final c

    sin2 = MAX(1.0 - costh12*costh12,0.0);