60 |
|
|
61 |
|
public: |
62 |
|
|
63 |
< |
CubicTorsionType(double k3, double k2, double k1, double k0) |
63 |
> |
CubicTorsionType(RealType k3, RealType k2, RealType k1, RealType k0) |
64 |
|
: k3_(k3), k2_(k2), k1_(k1), k0_(k0){ |
65 |
|
} |
66 |
|
|
67 |
< |
void setForceConstant(double k3, double k2, double k1, double k0) { |
67 |
> |
void setForceConstant(RealType k3, RealType k2, RealType k1, RealType k0) { |
68 |
|
k3_ = k3; |
69 |
|
k2_ = k2; |
70 |
|
k1_ = k1; |
71 |
|
k0_ = k0; |
72 |
|
} |
73 |
|
|
74 |
< |
void getForceConstant(double& k3, double& k2, double& k1, double& k0) { |
74 |
> |
void getForceConstant(RealType& k3, RealType& k2, RealType& k1, RealType& k0) { |
75 |
|
k3 = k3_; |
76 |
|
k2 = k2_; |
77 |
|
k1 = k1_; |
78 |
|
k0 = k0_; |
79 |
|
} |
80 |
|
|
81 |
< |
virtual void calcForce(double cosPhi, double& V, double& dVdCosPhi){ |
82 |
< |
double cosPhi2 = cosPhi * cosPhi; |
83 |
< |
double cosPhi3 = cosPhi2 * cosPhi; |
81 |
> |
virtual void calcForce(RealType cosPhi, RealType& V, RealType& dVdCosPhi){ |
82 |
> |
RealType cosPhi2 = cosPhi * cosPhi; |
83 |
> |
RealType cosPhi3 = cosPhi2 * cosPhi; |
84 |
|
|
85 |
|
V =k0_ + k1_ * cosPhi + k2_*cosPhi2 + k3_*cosPhi3; |
86 |
|
dVdCosPhi = k1_ + 2.0*k2_ * cosPhi + 3.0 * k3_*cosPhi2; |
88 |
|
|
89 |
|
private: |
90 |
|
|
91 |
< |
double k3_; |
92 |
< |
double k2_; |
93 |
< |
double k1_; |
94 |
< |
double k0_; |
91 |
> |
RealType k3_; |
92 |
> |
RealType k2_; |
93 |
> |
RealType k1_; |
94 |
> |
RealType k0_; |
95 |
|
|
96 |
|
}; |
97 |
|
|