1 |
< |
#include <cmath> |
1 |
> |
#include <math.h> |
2 |
|
#include <iostream> |
3 |
|
using namespace std; |
4 |
|
|
104 |
|
potential = potential_local; |
105 |
|
#endif // is_mpi |
106 |
|
|
107 |
– |
#ifdef IS_MPI |
108 |
– |
/* |
109 |
– |
std::cerr << "node " << worldRank << ": after pot = " << potential << "\n"; |
110 |
– |
*/ |
111 |
– |
#endif |
112 |
– |
|
107 |
|
return potential; |
108 |
|
} |
109 |
|
|
122 |
|
|
123 |
|
temperature = ( 2.0 * this->getKinetic() ) / ((double)info->ndf * kb ); |
124 |
|
return temperature; |
131 |
– |
} |
132 |
– |
|
133 |
– |
double Thermo::getEnthalpy() { |
134 |
– |
|
135 |
– |
const double e_convert = 4.184E-4; // convert kcal/mol -> (amu A^2)/fs^2 |
136 |
– |
double u, p, v; |
137 |
– |
double press[3][3]; |
138 |
– |
|
139 |
– |
u = this->getTotalE(); |
140 |
– |
|
141 |
– |
this->getPressureTensor(press); |
142 |
– |
p = (press[0][0] + press[1][1] + press[2][2]) / 3.0; |
143 |
– |
|
144 |
– |
v = this->getVolume(); |
145 |
– |
|
146 |
– |
return (u + (p*v)/e_convert); |
125 |
|
} |
126 |
|
|
127 |
|
double Thermo::getVolume() { |
279 |
|
|
280 |
|
av2 = 2.0 * kebar / atoms[vr]->getMass(); |
281 |
|
vbar = sqrt( av2 ); |
282 |
< |
|
305 |
< |
// vbar = sqrt( 8.31451e-7 * temperature / atoms[vr]->getMass() ); |
306 |
< |
|
282 |
> |
|
283 |
|
// picks random velocities from a gaussian distribution |
284 |
|
// centered on vbar |
285 |
|
|