ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/branches/new_design/OOPSE-3.0/src/types/HarmonicBondType.hpp
Revision: 1746
Committed: Wed Nov 17 06:37:56 2004 UTC (19 years, 9 months ago) by tim
File size: 702 byte(s)
Log Message:
add  PolynomialBondType, PolynomialBendType, PolynomialTorsionType, HarmonicBendType and CharmmTorsionType. Need to refine the design and add document for them

File Contents

# User Rev Content
1 gezelter 1743 #ifndef TYPES_HARMONICBONDTYPE_HPP
2     #define TYPES_HARMONICBONDTYPE_HPP
3    
4     #include "types/BondType.hpp"
5    
6     namespace oopse {
7     /**
8     * @class HarmonicBondType
9     *
10     * HarmonicBondType is the basic OOPSE bond type.
11     */
12     class HarmonicBondType : public BondType {
13    
14     public:
15    
16 tim 1746 HarmonicBondType(double myR0, double myK) : BondType(myR0) {
17 gezelter 1743 k = myK;
18     }
19    
20     void setForceConstant(double myK) {k = myK; }
21    
22     double getForceConstant() {return k;}
23    
24     void calcForce(double r, double& V, double& dVdr) {
25     double dr;
26    
27     dr = r - r0;
28    
29     V = 0.5 * k * dr * dr;
30     dVdr = k * dr;
31     }
32    
33     private:
34    
35     double r0;
36     double k;
37    
38     };
39     }
40     #endif