218 |
|
e_out->writeStat( 0.0 ); |
219 |
|
|
220 |
|
calcPot = 0; |
221 |
+ |
|
222 |
+ |
if (!strcasecmp( entry_plug->ensemble, "NPT")) { |
223 |
+ |
calcStress = 1; |
224 |
+ |
} else { |
225 |
+ |
calcStress = 0; |
226 |
+ |
} |
227 |
|
|
228 |
|
if( n_constrained ){ |
229 |
|
|
241 |
|
|
242 |
|
|
243 |
|
for( tl=0; tl < n_loops; tl++ ){ |
244 |
+ |
|
245 |
+ |
if (!strcasecmp( entry_plug->ensemble, "NVT")) |
246 |
+ |
myES->NoseHooverNVT( dt / 2.0 , tStats->getKinetic() ); |
247 |
|
|
248 |
|
for( j=0; j<nAtoms; j++ ){ |
249 |
|
|
409 |
|
// } |
410 |
|
// } |
411 |
|
|
412 |
+ |
|
413 |
+ |
if (!strcasecmp( entry_plug->ensemble, "NVT")) |
414 |
+ |
myES->NoseHooverNVT( dt / 2.0, tStats->getKinetic() ); |
415 |
+ |
|
416 |
+ |
if (!strcasecmp( entry_plug->ensemble, "NPT") ) |
417 |
+ |
myES->NoseHooverAndersonNPT( dt, |
418 |
+ |
tStats->getKinetic(), |
419 |
+ |
tStats->getPressure()); |
420 |
+ |
|
421 |
|
time = tl + 1; |
422 |
|
|
423 |
|
if( entry_plug->setTemp ){ |
426 |
|
if( !(time % sample_n) ) dump_out->writeDump( time * dt ); |
427 |
|
if( !((time+1) % status_n) ) { |
428 |
|
calcPot = 1; |
429 |
< |
calcStress = 1; |
429 |
> |
// bitwise masking in case we need it for NPT |
430 |
> |
calcStress = (!strcasecmp(entry_plug->ensemble,"NPT")) && 1; |
431 |
|
} |
432 |
|
if( !(time % status_n) ){ |
433 |
|
e_out->writeStat( time * dt ); |
434 |
|
calcPot = 0; |
435 |
< |
calcStress = 0; |
435 |
> |
// bitwise masking in case we need it for NPT |
436 |
> |
calcStress = (!strcasecmp(entry_plug->ensemble,"NPT")) && 0; |
437 |
|
} |
438 |
|
} |
439 |
|
} |
444 |
|
kE = 0.0; |
445 |
|
rot_kE= 0.0; |
446 |
|
trans_kE = 0.0; |
447 |
+ |
|
448 |
+ |
if (!strcasecmp( entry_plug->ensemble, "NVT")) |
449 |
+ |
myES->NoseHooverNVT( dt / 2.0, tStats->getKinetic() ); |
450 |
|
|
451 |
|
for( i=0; i<nAtoms; i++ ){ |
452 |
|
|
587 |
|
// dAtom->setJz( ji[2] ); |
588 |
|
// } |
589 |
|
} |
590 |
< |
|
590 |
> |
|
591 |
> |
if (!strcasecmp( entry_plug->ensemble, "NVT")) |
592 |
> |
myES->NoseHooverNVT( dt / 2.0, tStats->getKinetic() ); |
593 |
> |
|
594 |
> |
if (!strcasecmp( entry_plug->ensemble, "NPT") ) |
595 |
> |
myES->NoseHooverAndersonNPT( dt, |
596 |
> |
tStats->getKinetic(), |
597 |
> |
tStats->getPressure()); |
598 |
> |
|
599 |
|
time = tl + 1; |
600 |
|
|
601 |
|
if( entry_plug->setTemp ){ |
604 |
|
if( !(time % sample_n) ) dump_out->writeDump( time * dt ); |
605 |
|
if( !((time+1) % status_n) ) { |
606 |
|
calcPot = 1; |
607 |
< |
calcStress = 1; |
607 |
> |
// bitwise masking in case we need it for NPT |
608 |
> |
calcStress = (!strcasecmp(entry_plug->ensemble,"NPT")) && 1; |
609 |
|
} |
610 |
|
if( !(time % status_n) ){ |
611 |
|
e_out->writeStat( time * dt ); |
612 |
|
calcPot = 0; |
613 |
< |
calcStress = 0; |
613 |
> |
// bitwise masking in case we need it for NPT |
614 |
> |
calcStress = (!strcasecmp(entry_plug->ensemble,"NPT")) && 0; |
615 |
|
} |
616 |
|
} |
617 |
|
} |