ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/branches/new_design/OOPSE-3.0/src/primitives/Bond.hpp
(Generate patch)

Comparing branches/new_design/OOPSE-3.0/src/primitives/Bond.hpp (file contents):
Revision 1695 by tim, Mon Nov 1 22:52:57 2004 UTC vs.
Revision 1782 by tim, Wed Nov 24 20:55:03 2004 UTC

# Line 34 | Line 34
34   #ifndef PRIMITIVES_BOND_HPP
35   #define PRIMITIVES_BOND_HPP
36  
37 + #include "primitives/Atom.hpp"
38   #include "types/BondType.hpp"
39  
40   namespace oopse {
# Line 44 | Line 45 | class Bond {
45  
46          void calcForce() {
47              double len;
48 <            double totalForce;
48 >            double dvdr;
49              Vector3d r12;
50              Vector3d force;
51  
52 <            r12 = atom2->getPos() - atom1->getPos();
52 >            r12 = atom2_->getPos() - atom1_->getPos();
53              len = r12.length();            
54 <            bondType_->calcForce(len, totalForce, potential);
54 >            bondType_->calcForce(len,  potential_, dvdr);
55  
56 <            force = r12 * (-totalForce / len);
56 >            force = r12 * (-dvdr / len);
57              
58 <            atom1->addFrc(force);
59 <            atom1->addFrc(-force);
58 >            atom1_->addFrc(force);
59 >            atom2_->addFrc(-force);
60         }
61          
62          double getPotential() {
63 <            return potential;
63 >            return potential_;
64          }
65  
66      private:
67 +        
68          BondType* bondType_; /**< bond type */
69 <        Atom* atom1;
70 <        Atom* atom2;
71 <        double potential;
69 >        Atom* atom1_;
70 >        Atom* atom2_;
71 >        double potential_;
72   };    
73  
74  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines