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

Comparing trunk/OOPSE-4/src/primitives/GhostTorsion.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 46 | Line 46 | namespace oopse {
46    GhostTorsion::GhostTorsion(Atom *atom1, Atom *atom2,  DirectionalAtom* ghostAtom,
47                               TorsionType *tt) : Torsion(atom1, atom2, ghostAtom, ghostAtom, tt) {}
48  
49 <  void GhostTorsion::calcForce(double& angle) {
49 >  void GhostTorsion::calcForce(RealType& angle) {
50      DirectionalAtom* ghostAtom = static_cast<DirectionalAtom*>(atom3_);    
51  
52      Vector3d pos1 = atom1_->getPos();
# Line 59 | Line 59 | namespace oopse {
59  
60      //  Calculate the cross products and distances
61      Vector3d A = cross(r21, r32);
62 <    double rA = A.length();
62 >    RealType rA = A.length();
63      Vector3d B = cross(r32, r43);
64 <    double rB = B.length();
64 >    RealType rB = B.length();
65      Vector3d C = cross(r32, A);
66 <    double rC = C.length();
66 >    RealType rC = C.length();
67  
68      A.normalize();
69      B.normalize();
70      C.normalize();
71      
72      //  Calculate the sin and cos
73 <    double cos_phi = dot(A, B) ;
73 >    RealType cos_phi = dot(A, B) ;
74  
75 <    double dVdcosPhi;
75 >    RealType dVdcosPhi;
76      torsionType_->calcForce(cos_phi, potential_, dVdcosPhi);
77  
78      Vector3d dcosdA = (cos_phi * A - B) /rA;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines