| 16 |
|
#include "mpiSimulation.hpp" |
| 17 |
|
#endif // is_mpi |
| 18 |
|
|
| 19 |
– |
|
| 20 |
– |
#define BASE_SEED 123456789 |
| 21 |
– |
|
| 19 |
|
Thermo::Thermo( SimInfo* the_info ) { |
| 20 |
|
info = the_info; |
| 21 |
< |
int baseSeed = BASE_SEED; |
| 21 |
> |
int baseSeed = the_info->getSeed(); |
| 22 |
|
|
| 23 |
|
gaussStream = new gaussianSPRNG( baseSeed ); |
| 24 |
|
} |
| 164 |
|
pressure = p_convert * (press[0][0] + press[1][1] + press[2][2]) / 3.0; |
| 165 |
|
|
| 166 |
|
return pressure; |
| 167 |
+ |
} |
| 168 |
+ |
|
| 169 |
+ |
double Thermo::getPressureX() { |
| 170 |
+ |
|
| 171 |
+ |
// Relies on the calculation of the full molecular pressure tensor |
| 172 |
+ |
|
| 173 |
+ |
const double p_convert = 1.63882576e8; |
| 174 |
+ |
double press[3][3]; |
| 175 |
+ |
double pressureX; |
| 176 |
+ |
|
| 177 |
+ |
this->getPressureTensor(press); |
| 178 |
+ |
|
| 179 |
+ |
pressureX = p_convert * press[0][0]; |
| 180 |
+ |
|
| 181 |
+ |
return pressureX; |
| 182 |
+ |
} |
| 183 |
+ |
|
| 184 |
+ |
double Thermo::getPressureY() { |
| 185 |
+ |
|
| 186 |
+ |
// Relies on the calculation of the full molecular pressure tensor |
| 187 |
+ |
|
| 188 |
+ |
const double p_convert = 1.63882576e8; |
| 189 |
+ |
double press[3][3]; |
| 190 |
+ |
double pressureY; |
| 191 |
+ |
|
| 192 |
+ |
this->getPressureTensor(press); |
| 193 |
+ |
|
| 194 |
+ |
pressureY = p_convert * press[1][1]; |
| 195 |
+ |
|
| 196 |
+ |
return pressureY; |
| 197 |
|
} |
| 198 |
|
|
| 199 |
+ |
double Thermo::getPressureZ() { |
| 200 |
|
|
| 201 |
+ |
// Relies on the calculation of the full molecular pressure tensor |
| 202 |
+ |
|
| 203 |
+ |
const double p_convert = 1.63882576e8; |
| 204 |
+ |
double press[3][3]; |
| 205 |
+ |
double pressureZ; |
| 206 |
+ |
|
| 207 |
+ |
this->getPressureTensor(press); |
| 208 |
+ |
|
| 209 |
+ |
pressureZ = p_convert * press[2][2]; |
| 210 |
+ |
|
| 211 |
+ |
return pressureZ; |
| 212 |
+ |
} |
| 213 |
+ |
|
| 214 |
+ |
|
| 215 |
|
void Thermo::getPressureTensor(double press[3][3]){ |
| 216 |
|
// returns pressure tensor in units amu*fs^-2*Ang^-1 |
| 217 |
|
// routine derived via viral theorem description in: |