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

Comparing trunk/OOPSE-4/src/types/HarmonicBondType.hpp (file contents):
Revision 3172 by tim, Wed May 17 21:51:42 2006 UTC vs.
Revision 3173 by gezelter, Fri Jul 13 18:10:52 2007 UTC

# Line 54 | Line 54 | namespace oopse {
54    class HarmonicBondType : public BondType {
55      
56    public:
57 <
57 >    
58      HarmonicBondType(RealType myR0, RealType myK) : BondType(myR0) {
59        k = myK;
60      }
61      
62      void setForceConstant(RealType myK) {k = myK; }
63 <
63 >    
64      RealType getForceConstant() {return k;}
65 <
65 >    
66      virtual void calcForce(RealType r, RealType& V, RealType& dVdr) {
67        RealType dr;
68 <
68 >      
69        dr = r - r0;
70        
71        V = 0.5 * k * dr * dr;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines