| 1 |
#include "primitives/SRI.hpp" |
| 2 |
|
| 3 |
CubicTorsion::CubicTorsion( Atom &a, Atom &b, Atom &c, Atom &d ){ |
| 4 |
|
| 5 |
set_atoms( a, b, c, d ); |
| 6 |
k1 = 0.0; |
| 7 |
k2 = 0.0; |
| 8 |
k3 = 0.0; |
| 9 |
k4 = 0.0; |
| 10 |
} |
| 11 |
|
| 12 |
void CubicTorsion::setConstants( double the_k1, double the_k2, double the_k3, |
| 13 |
double the_k4 ){ |
| 14 |
|
| 15 |
k1 = the_k1; |
| 16 |
k2 = the_k2; |
| 17 |
k3 = the_k3; |
| 18 |
k4 = the_k4; |
| 19 |
} |
| 20 |
|
| 21 |
double CubicTorsion::torsion_force( double cos_phi ){ |
| 22 |
|
| 23 |
double cp, cp2, cp3; |
| 24 |
double force; |
| 25 |
|
| 26 |
cp = cos_phi; |
| 27 |
cp2 = cp * cp; |
| 28 |
cp3 = cp2 * cp; |
| 29 |
|
| 30 |
c_potential_E = ( k1 * cp3 ) + ( k2 * cp2 ) + ( k3 * cp ) + k4; |
| 31 |
|
| 32 |
force = -( ( 3.0 * k1 * cp2 ) + ( 2.0 * k2 * cp ) + k3 ); |
| 33 |
return force; |
| 34 |
} |