58 |
|
* @todo documentation |
59 |
|
*/ |
60 |
|
class HarmonicBendType : public BendType { |
61 |
< |
|
61 |
> |
|
62 |
|
public: |
63 |
< |
|
64 |
< |
HarmonicBendType(double theta, double k) : BendType(theta) , k_(k){ |
63 |
> |
|
64 |
> |
HarmonicBendType(RealType theta, RealType k) : BendType(theta), k_(k) { |
65 |
|
} |
66 |
< |
|
67 |
< |
void setForceConstant(double k) {k_ = k; } |
68 |
< |
|
69 |
< |
double getForceConstant() {return k_;} |
70 |
< |
|
71 |
< |
void calcForce(double theta, double& V, double& dVdr) { |
72 |
< |
double delta = theta - theta0_; |
73 |
< |
|
66 |
> |
|
67 |
> |
void setForceConstant(RealType k) {k_ = k; } |
68 |
> |
|
69 |
> |
RealType getForceConstant() {return k_;} |
70 |
> |
|
71 |
> |
void calcForce(RealType theta, RealType& V, RealType& dVdr) { |
72 |
> |
RealType delta = theta - theta0_; |
73 |
> |
|
74 |
|
V = 0.5 * k_ * delta * delta; |
75 |
|
dVdr = k_ * delta; |
76 |
|
} |
77 |
< |
|
77 |
> |
|
78 |
|
private: |
79 |
< |
double k_; |
80 |
< |
|
79 |
> |
RealType k_; |
80 |
> |
|
81 |
|
}; |
82 |
< |
|
82 |
> |
|
83 |
|
}//end namespace oopse |
84 |
|
#endif //TYPES_HARMONICBENDTYPE_HPP |
85 |
|
|