| 38 |
|
myES = the_es; |
| 39 |
|
isFirst = 1; |
| 40 |
|
|
| 41 |
– |
std::cerr<< "calling symplectic constructor\n"; |
| 42 |
– |
|
| 41 |
|
molecules = entry_plug->molecules; |
| 42 |
|
nMols = entry_plug->n_mol; |
| 43 |
|
|
| 170 |
|
double Tb[3]; // torque in the body frame |
| 171 |
|
double angle; // the angle through which to rotate the rotation matrix |
| 172 |
|
double A[3][3]; // the rotation matrix |
| 173 |
+ |
double press[9]; |
| 174 |
|
|
| 175 |
|
int time; |
| 176 |
|
|
| 191 |
|
StatWriter* e_out; |
| 192 |
|
DumpWriter* dump_out; |
| 193 |
|
|
| 195 |
– |
std::cerr << "about to call new thermo\n"; |
| 196 |
– |
|
| 194 |
|
tStats = new Thermo( entry_plug ); |
| 195 |
|
e_out = new StatWriter( entry_plug ); |
| 199 |
– |
|
| 200 |
– |
std::cerr << "calling dumpWriter \n"; |
| 196 |
|
dump_out = new DumpWriter( entry_plug ); |
| 202 |
– |
std::cerr << "called dumpWriter \n"; |
| 197 |
|
|
| 198 |
|
Atom** atoms = entry_plug->atoms; |
| 199 |
|
DirectionalAtom* dAtom; |
| 407 |
|
if (!strcasecmp( entry_plug->ensemble, "NVT")) |
| 408 |
|
myES->NoseHooverNVT( dt / 2.0, tStats->getKinetic() ); |
| 409 |
|
|
| 410 |
< |
if (!strcasecmp( entry_plug->ensemble, "NPT") ) |
| 410 |
> |
if (!strcasecmp( entry_plug->ensemble, "NPT") ) { |
| 411 |
> |
tStats->getPressureTensor(press); |
| 412 |
|
myES->NoseHooverAndersonNPT( dt, |
| 413 |
|
tStats->getKinetic(), |
| 414 |
< |
tStats->getPressure()); |
| 414 |
> |
press); |
| 415 |
> |
} |
| 416 |
|
|
| 417 |
|
time = tl + 1; |
| 418 |
|
|
| 422 |
|
if( !(time % sample_n) ) dump_out->writeDump( time * dt ); |
| 423 |
|
if( !((time+1) % status_n) ) { |
| 424 |
|
calcPot = 1; |
| 425 |
< |
// bitwise masking in case we need it for NPT |
| 430 |
< |
calcStress = (!strcasecmp(entry_plug->ensemble,"NPT")) && 1; |
| 425 |
> |
calcStress = 1; |
| 426 |
|
} |
| 427 |
|
if( !(time % status_n) ){ |
| 428 |
|
e_out->writeStat( time * dt ); |
| 429 |
|
calcPot = 0; |
| 430 |
< |
// bitwise masking in case we need it for NPT |
| 431 |
< |
calcStress = (!strcasecmp(entry_plug->ensemble,"NPT")) && 0; |
| 430 |
> |
if (!strcasecmp(entry_plug->ensemble, "NPT")) calcStress = 1; |
| 431 |
> |
else calcStress = 0; |
| 432 |
|
} |
| 433 |
|
} |
| 434 |
|
} |
| 580 |
|
dAtom->setJx( ji[0] ); |
| 581 |
|
dAtom->setJy( ji[1] ); |
| 582 |
|
dAtom->setJz( ji[2] ); |
| 583 |
< |
} |
| 583 |
> |
} |
| 584 |
> |
|
| 585 |
|
} |
| 586 |
|
|
| 587 |
|
if (!strcasecmp( entry_plug->ensemble, "NVT")) |
| 588 |
|
myES->NoseHooverNVT( dt / 2.0, tStats->getKinetic() ); |
| 589 |
|
|
| 590 |
< |
if (!strcasecmp( entry_plug->ensemble, "NPT") ) |
| 590 |
> |
if (!strcasecmp( entry_plug->ensemble, "NPT") ) { |
| 591 |
> |
tStats->getPressureTensor(press); |
| 592 |
|
myES->NoseHooverAndersonNPT( dt, |
| 593 |
|
tStats->getKinetic(), |
| 594 |
< |
tStats->getPressure()); |
| 594 |
> |
press); |
| 595 |
> |
} |
| 596 |
|
|
| 597 |
|
time = tl + 1; |
| 598 |
|
|
| 602 |
|
if( !(time % sample_n) ) dump_out->writeDump( time * dt ); |
| 603 |
|
if( !((time+1) % status_n) ) { |
| 604 |
|
calcPot = 1; |
| 605 |
< |
// bitwise masking in case we need it for NPT |
| 608 |
< |
calcStress = (!strcasecmp(entry_plug->ensemble,"NPT")) && 1; |
| 605 |
> |
calcStress = 1; |
| 606 |
|
} |
| 607 |
|
if( !(time % status_n) ){ |
| 608 |
|
e_out->writeStat( time * dt ); |
| 609 |
|
calcPot = 0; |
| 610 |
< |
// bitwise masking in case we need it for NPT |
| 611 |
< |
calcStress = (!strcasecmp(entry_plug->ensemble,"NPT")) && 0; |
| 610 |
> |
if (!strcasecmp(entry_plug->ensemble, "NPT")) calcStress = 1; |
| 611 |
> |
else calcStress = 0; |
| 612 |
|
} |
| 613 |
|
} |
| 614 |
|
} |