1 |
< |
/* |
1 |
> |
/* |
2 |
|
* Copyright (c) 2005 The University of Notre Dame. All Rights Reserved. |
3 |
|
* |
4 |
|
* The University of Notre Dame grants you ("Licensee") a |
54 |
|
class HarmonicBondType : public BondType { |
55 |
|
|
56 |
|
public: |
57 |
< |
|
58 |
< |
HarmonicBondType(double myR0, double myK) : BondType(myR0) { |
57 |
> |
|
58 |
> |
HarmonicBondType(RealType myR0, RealType myK) : BondType(myR0) { |
59 |
|
k = myK; |
60 |
|
} |
61 |
|
|
62 |
< |
void setForceConstant(double myK) {k = myK; } |
63 |
< |
|
64 |
< |
double getForceConstant() {return k;} |
65 |
< |
|
66 |
< |
virtual void calcForce(double r, double& V, double& dVdr) { |
67 |
< |
double dr; |
68 |
< |
|
62 |
> |
void setForceConstant(RealType myK) {k = myK; } |
63 |
> |
|
64 |
> |
RealType getForceConstant() {return k;} |
65 |
> |
|
66 |
> |
virtual void calcForce(RealType r, RealType& V, RealType& dVdr) { |
67 |
> |
RealType dr; |
68 |
> |
|
69 |
|
dr = r - r0; |
70 |
|
|
71 |
|
V = 0.5 * k * dr * dr; |
74 |
|
|
75 |
|
private: |
76 |
|
|
77 |
< |
double k; |
77 |
> |
RealType k; |
78 |
|
|
79 |
|
}; |
80 |
|
} |