1 |
mmeineke |
270 |
#include <cmath> |
2 |
|
|
|
3 |
|
|
#include "SRI.hpp" |
4 |
|
|
|
5 |
|
|
QuadraticBend::QuadraticBend( Atom &a, Atom &b, Atom &c ){ |
6 |
|
|
|
7 |
|
|
set_atoms( a, b, c ); |
8 |
|
|
c1 = 0.0; |
9 |
|
|
c2 = 0.0; |
10 |
|
|
c3 = 0.0; |
11 |
|
|
theta0 = 0.0; |
12 |
|
|
} |
13 |
|
|
|
14 |
|
|
void QuadraticBend::setConstants( double the_c1, double the_c2, double the_c3, |
15 |
|
|
double the_Th0 ){ |
16 |
|
|
c1 = the_c1; |
17 |
|
|
c2 = the_c2; |
18 |
|
|
c3 = the_c3; |
19 |
|
|
theta0 = the_Th0; |
20 |
|
|
} |
21 |
|
|
|
22 |
|
|
|
23 |
|
|
double QuadraticBend::bend_force( double theta ){ |
24 |
|
|
|
25 |
|
|
double dt, dt2; |
26 |
|
|
double force; |
27 |
|
|
|
28 |
|
|
dt = ( theta - theta0 ) * M_PI / 180.0; |
29 |
|
|
dt2 = dt * dt; |
30 |
|
|
|
31 |
|
|
c_potential_E = ( c1 * dt2 ) + ( c2 * dt ) + c3; |
32 |
|
|
force = -( ( 2.0 * c1 * dt ) + c2 ); |
33 |
|
|
return force; |
34 |
|
|
} |