| 29 |
|
{ |
| 30 |
|
int i, j; |
| 31 |
|
chi = 0.0; |
| 32 |
< |
|
| 32 |
> |
integralOfChidt = 0.0; |
| 33 |
> |
|
| 34 |
|
for(i = 0; i < 3; i++) |
| 35 |
|
for (j = 0; j < 3; j++) |
| 36 |
|
eta[i][j] = 0.0; |
| 397 |
|
|
| 398 |
|
return 1; |
| 399 |
|
} |
| 400 |
+ |
|
| 401 |
+ |
template<typename T> double NPTfm<T>::getConservedQuantity(void){ |
| 402 |
+ |
|
| 403 |
+ |
double conservedQuantity; |
| 404 |
+ |
double tb2; |
| 405 |
+ |
double trEta; |
| 406 |
+ |
|
| 407 |
+ |
//HNVE |
| 408 |
+ |
conservedQuantity = tStats->getTotalE(); |
| 409 |
+ |
|
| 410 |
+ |
//HNVT |
| 411 |
+ |
conservedQuantity += (info->getNDF() * kB * targetTemp * |
| 412 |
+ |
(integralOfChidt + tauThermostat * tauThermostat * chi * chi / 2.0)) / eConvert ; |
| 413 |
+ |
|
| 414 |
+ |
//HNPT |
| 415 |
+ |
tb2 = tauBarostat *tauBarostat; |
| 416 |
+ |
|
| 417 |
+ |
trEta = info->matTrace3(eta); |
| 418 |
+ |
|
| 419 |
+ |
conservedQuantity += (targetPressure * tStats->getVolume() / p_convert + |
| 420 |
+ |
3*NkBT/2 * tb2 * trEta * trEta) / eConvert; |
| 421 |
+ |
|
| 422 |
+ |
return conservedQuantity; |
| 423 |
+ |
} |