ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-4/src/primitives/Torsion.cpp
(Generate patch)

Comparing trunk/OOPSE-4/src/primitives/Torsion.cpp (file contents):
Revision 2448 by tim, Wed Nov 16 23:10:02 2005 UTC vs.
Revision 2759 by tim, Wed May 17 21:51:42 2006 UTC

# Line 47 | Line 47 | namespace oopse {
47                     TorsionType *tt) :
48      atom1_(atom1), atom2_(atom2), atom3_(atom3), atom4_(atom4), torsionType_(tt) { }
49  
50 <  void Torsion::calcForce(double& angle) {
50 >  void Torsion::calcForce(RealType& angle) {
51  
52      Vector3d pos1 = atom1_->getPos();
53      Vector3d pos2 = atom2_->getPos();
# Line 60 | Line 60 | namespace oopse {
60  
61      //  Calculate the cross products and distances
62      Vector3d A = cross(r21, r32);
63 <    double rA = A.length();
63 >    RealType rA = A.length();
64      Vector3d B = cross(r32, r43);
65 <    double rB = B.length();
65 >    RealType rB = B.length();
66      Vector3d C = cross(r32, A);
67 <    double rC = C.length();
67 >    RealType rC = C.length();
68  
69      A.normalize();
70      B.normalize();
71      C.normalize();
72      
73      //  Calculate the sin and cos
74 <    double cos_phi = dot(A, B) ;
74 >    RealType cos_phi = dot(A, B) ;
75      if (cos_phi > 1.0) cos_phi = 1.0;
76      if (cos_phi < -1.0) cos_phi = -1.0;
77  
78 <    double dVdcosPhi;
78 >    RealType dVdcosPhi;
79      torsionType_->calcForce(cos_phi, potential_, dVdcosPhi);
80      Vector3d f1;
81      Vector3d f2;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines