195 |
|
|
196 |
|
double tt2, tb2; |
197 |
|
double instaTemp, instaPress, instaVol; |
198 |
+ |
double press[3][3]; |
199 |
|
|
200 |
|
int Nparticles; |
201 |
|
|
251 |
|
int index, double sc[3]); |
252 |
|
|
253 |
|
double eta, oldEta, prevEta; |
253 |
– |
}; |
254 |
– |
|
255 |
– |
|
256 |
– |
template<typename T> class NPTim : public T{ |
257 |
– |
|
258 |
– |
public: |
259 |
– |
|
260 |
– |
NPTim ( SimInfo *theInfo, ForceFields* the_ff); |
261 |
– |
virtual ~NPTim() {} |
262 |
– |
|
263 |
– |
virtual void integrateStep( int calcPot, int calcStress ){ |
264 |
– |
calcStress = 1; |
265 |
– |
T::integrateStep( calcPot, calcStress ); |
266 |
– |
accIntegralOfChidt(); |
267 |
– |
} |
268 |
– |
|
269 |
– |
virtual double getConservedQuantity(void); |
270 |
– |
|
271 |
– |
void setTauThermostat(double tt) {tauThermostat = tt; have_tau_thermostat=1;} |
272 |
– |
void setTauBarostat(double tb) {tauBarostat = tb; have_tau_barostat=1;} |
273 |
– |
void setTargetTemp(double tt) {targetTemp = tt; have_target_temp = 1;} |
274 |
– |
void setTargetPressure(double tp) {targetPressure = tp; have_target_pressure = 1;} |
275 |
– |
void setChiTolerance(double tol) {chiTolerance = tol;} |
276 |
– |
void setPosIterTolerance(double tol) {posIterTolerance = tol;} |
277 |
– |
|
278 |
– |
protected: |
279 |
– |
|
280 |
– |
virtual void moveA( void ); |
281 |
– |
virtual void moveB( void ); |
282 |
– |
|
283 |
– |
virtual int readyCheck(); |
284 |
– |
|
285 |
– |
virtual void resetIntegrator( void ); |
286 |
– |
|
287 |
– |
void accIntegralOfChidt(void) { integralOfChidt += dt * chi;} |
288 |
– |
|
289 |
– |
Molecule* myMolecules; |
290 |
– |
Atom** myAtoms; |
291 |
– |
|
292 |
– |
// chi and eta are the propagated degrees of freedom |
293 |
– |
|
294 |
– |
double chi; |
295 |
– |
double eta; |
296 |
– |
double NkBT; |
297 |
– |
double integralOfChidt; |
298 |
– |
|
299 |
– |
// targetTemp, targetPressure, and tauBarostat must be set. |
300 |
– |
// One of qmass or tauThermostat must be set; |
301 |
– |
|
302 |
– |
double targetTemp; |
303 |
– |
double targetPressure; |
304 |
– |
double tauThermostat; |
305 |
– |
double tauBarostat; |
306 |
– |
|
307 |
– |
short int have_tau_thermostat, have_tau_barostat, have_target_temp; |
308 |
– |
short int have_target_pressure; |
309 |
– |
double chiTolerance; |
310 |
– |
short int have_chi_tolerance; |
311 |
– |
double posIterTolerance; |
312 |
– |
short int have_pos_iter_tolerance; |
313 |
– |
|
254 |
|
}; |
255 |
|
|
256 |
|
template<typename T> class NPTzm : public T{ |
309 |
|
NPTf ( SimInfo *theInfo, ForceFields* the_ff); |
310 |
|
virtual ~NPTf(); |
311 |
|
|
372 |
– |
virtual void integrateStep( int calcPot, int calcStress ){ |
373 |
– |
calcStress = 1; |
374 |
– |
T::integrateStep( calcPot, calcStress ); |
375 |
– |
} |
376 |
– |
|
312 |
|
virtual double getConservedQuantity(void); |
313 |
+ |
virtual void resetIntegrator(void); |
314 |
|
|
379 |
– |
void setTauThermostat(double tt) {tauThermostat = tt; have_tau_thermostat=1;} |
380 |
– |
void setTauBarostat(double tb) {tauBarostat = tb; have_tau_barostat=1;} |
381 |
– |
void setTargetTemp(double tt) {targetTemp = tt; have_target_temp = 1;} |
382 |
– |
void setTargetPressure(double tp) {targetPressure = tp; have_target_pressure = 1;} |
383 |
– |
void setChiTolerance(double tol) {chiTolerance = tol;} |
384 |
– |
void setPosIterTolerance(double tol) {posIterTolerance = tol;} |
385 |
– |
|
315 |
|
protected: |
316 |
|
|
317 |
< |
virtual void moveA( void ); |
318 |
< |
virtual void moveB( void ); |
317 |
> |
virtual void evolveEtaA(void); |
318 |
> |
virtual void evolveEtaB(void); |
319 |
|
|
320 |
< |
virtual void resetIntegrator( void ); |
320 |
> |
virtual bool etaConverged( void ); |
321 |
|
|
322 |
< |
virtual int readyCheck(); |
322 |
> |
virtual void scaleSimBox( void ); |
323 |
|
|
324 |
+ |
virtual void getVelScaleA( double sc[3], double vel[3] ); |
325 |
+ |
virtual void getVelScaleB( double sc[3], int index ); |
326 |
+ |
virtual void getPosScale(double pos[3], double COM[3], |
327 |
+ |
int index, double sc[3]); |
328 |
|
|
396 |
– |
// chi and eta are the propagated degrees of freedom |
397 |
– |
|
398 |
– |
double chi; |
329 |
|
double eta[3][3]; |
330 |
< |
double NkBT; |
331 |
< |
double fkBT; |
402 |
< |
|
403 |
< |
int Nparticles; |
404 |
< |
|
405 |
< |
double *oldPos; |
406 |
< |
double *oldVel; |
407 |
< |
double *oldJi; |
408 |
< |
|
409 |
< |
double integralOfChidt; |
410 |
< |
|
411 |
< |
// targetTemp, targetPressure, and tauBarostat must be set. |
412 |
< |
// One of qmass or tauThermostat must be set; |
413 |
< |
|
414 |
< |
double targetTemp; |
415 |
< |
double targetPressure; |
416 |
< |
double tauThermostat; |
417 |
< |
double tauBarostat; |
418 |
< |
|
419 |
< |
short int have_tau_thermostat, have_tau_barostat, have_target_temp; |
420 |
< |
short int have_target_pressure; |
421 |
< |
double chiTolerance; |
422 |
< |
short int have_chi_tolerance; |
423 |
< |
double posIterTolerance; |
424 |
< |
short int have_pos_iter_tolerance; |
425 |
< |
double etaTolerance; |
426 |
< |
short int have_eta_tolerance; |
330 |
> |
double oldEta[3][3]; |
331 |
> |
double prevEta[3][3]; |
332 |
|
}; |
333 |
|
|
334 |
|
template<typename T> class NPTxym : public T{ |
381 |
|
|
382 |
|
}; |
383 |
|
|
479 |
– |
|
480 |
– |
template<typename T> class NPTfm : public T{ |
481 |
– |
|
482 |
– |
public: |
483 |
– |
|
484 |
– |
NPTfm ( SimInfo *theInfo, ForceFields* the_ff); |
485 |
– |
virtual ~NPTfm() {}; |
486 |
– |
|
487 |
– |
virtual void integrateStep( int calcPot, int calcStress ){ |
488 |
– |
calcStress = 1; |
489 |
– |
T::integrateStep( calcPot, calcStress ); |
490 |
– |
accIntegralOfChidt(); |
491 |
– |
} |
492 |
– |
|
493 |
– |
virtual double getConservedQuantity(void); |
494 |
– |
|
495 |
– |
void setTauThermostat(double tt) {tauThermostat = tt; have_tau_thermostat=1;} |
496 |
– |
void setTauBarostat(double tb) {tauBarostat = tb; have_tau_barostat=1;} |
497 |
– |
void setTargetTemp(double tt) {targetTemp = tt; have_target_temp = 1;} |
498 |
– |
void setTargetPressure(double tp) {targetPressure = tp; have_target_pressure = 1;} |
499 |
– |
void setChiTolerance(double tol) {chiTolerance = tol;} |
500 |
– |
void setPosIterTolerance(double tol) {posIterTolerance = tol;} |
501 |
– |
|
502 |
– |
protected: |
503 |
– |
|
504 |
– |
virtual void moveA( void ); |
505 |
– |
virtual void moveB( void ); |
506 |
– |
|
507 |
– |
virtual void resetIntegrator( void ); |
508 |
– |
|
509 |
– |
virtual int readyCheck(); |
510 |
– |
|
511 |
– |
void accIntegralOfChidt(void) { integralOfChidt += dt * chi;} |
512 |
– |
|
513 |
– |
Molecule* myMolecules; |
514 |
– |
Atom** myAtoms; |
515 |
– |
|
516 |
– |
// chi and eta are the propagated degrees of freedom |
517 |
– |
|
518 |
– |
double chi; |
519 |
– |
double eta[3][3]; |
520 |
– |
double NkBT; |
521 |
– |
double integralOfChidt; |
522 |
– |
|
523 |
– |
// targetTemp, targetPressure, and tauBarostat must be set. |
524 |
– |
// One of qmass or tauThermostat must be set; |
525 |
– |
|
526 |
– |
double targetTemp; |
527 |
– |
double targetPressure; |
528 |
– |
double tauThermostat; |
529 |
– |
double tauBarostat; |
530 |
– |
|
531 |
– |
short int have_tau_thermostat, have_tau_barostat, have_target_temp; |
532 |
– |
short int have_target_pressure; |
533 |
– |
double chiTolerance; |
534 |
– |
short int have_chi_tolerance; |
535 |
– |
double posIterTolerance; |
536 |
– |
short int have_pos_iter_tolerance; |
537 |
– |
|
538 |
– |
}; |
539 |
– |
|
540 |
– |
|
541 |
– |
template<typename T> class NPTpr : public T{ |
542 |
– |
|
543 |
– |
public: |
544 |
– |
|
545 |
– |
NPTpr ( SimInfo *theInfo, ForceFields* the_ff); |
546 |
– |
virtual ~NPTpr() {}; |
547 |
– |
|
548 |
– |
virtual void integrateStep( int calcPot, int calcStress ){ |
549 |
– |
calcStress = 1; |
550 |
– |
T::integrateStep( calcPot, calcStress ); |
551 |
– |
} |
552 |
– |
|
553 |
– |
void setTauThermostat(double tt) {tauThermostat = tt; have_tau_thermostat=1;} |
554 |
– |
void setTauBarostat(double tb) {tauBarostat = tb; have_tau_barostat=1;} |
555 |
– |
void setTargetTemp(double tt) {targetTemp = tt; have_target_temp = 1;} |
556 |
– |
void setTargetPressure(double tp) {targetPressure = tp; have_target_pressure = 1;} |
557 |
– |
void setChiTolerance(double tol) {chiTolerance = tol;} |
558 |
– |
void setPosIterTolerance(double tol) {posIterTolerance = tol;} |
559 |
– |
|
560 |
– |
protected: |
561 |
– |
|
562 |
– |
virtual void moveA( void ); |
563 |
– |
virtual void moveB( void ); |
564 |
– |
|
565 |
– |
virtual int readyCheck(); |
566 |
– |
|
567 |
– |
virtual void resetIntegrator( void ); |
568 |
– |
|
569 |
– |
// chi and eta are the propagated degrees of freedom |
570 |
– |
|
571 |
– |
double chi; |
572 |
– |
double eta[3][3]; |
573 |
– |
double NkBT; |
574 |
– |
|
575 |
– |
// targetTemp, targetPressure, and tauBarostat must be set. |
576 |
– |
// One of qmass or tauThermostat must be set; |
577 |
– |
|
578 |
– |
double targetTemp; |
579 |
– |
double targetPressure; |
580 |
– |
double tauThermostat; |
581 |
– |
double tauBarostat; |
582 |
– |
|
583 |
– |
short int have_tau_thermostat, have_tau_barostat, have_target_temp; |
584 |
– |
short int have_target_pressure; |
585 |
– |
double chiTolerance; |
586 |
– |
short int have_chi_tolerance; |
587 |
– |
double posIterTolerance; |
588 |
– |
short int have_pos_iter_tolerance; |
589 |
– |
|
590 |
– |
}; |
591 |
– |
|
592 |
– |
|
384 |
|
template<typename T> class ZConstraint : public T { |
385 |
|
|
386 |
|
public: |