--- trunk/OOPSE/libmdtools/Integrator.hpp 2003/09/19 20:00:27 778 +++ trunk/OOPSE/libmdtools/Integrator.hpp 2003/09/22 21:23:25 780 @@ -195,6 +195,7 @@ template class NPT : public T{ (protected) double tt2, tb2; double instaTemp, instaPress, instaVol; + double press[3][3]; int Nparticles; @@ -251,68 +252,7 @@ template class NPTi : public T{ (protected double eta, oldEta, prevEta; }; - - -template class NPTim : public T{ - -public: - - NPTim ( SimInfo *theInfo, ForceFields* the_ff); - virtual ~NPTim() {} - - virtual void integrateStep( int calcPot, int calcStress ){ - calcStress = 1; - T::integrateStep( calcPot, calcStress ); - accIntegralOfChidt(); - } - - virtual double getConservedQuantity(void); - void setTauThermostat(double tt) {tauThermostat = tt; have_tau_thermostat=1;} - void setTauBarostat(double tb) {tauBarostat = tb; have_tau_barostat=1;} - void setTargetTemp(double tt) {targetTemp = tt; have_target_temp = 1;} - void setTargetPressure(double tp) {targetPressure = tp; have_target_pressure = 1;} - void setChiTolerance(double tol) {chiTolerance = tol;} - void setPosIterTolerance(double tol) {posIterTolerance = tol;} - -protected: - - virtual void moveA( void ); - virtual void moveB( void ); - - virtual int readyCheck(); - - virtual void resetIntegrator( void ); - - void accIntegralOfChidt(void) { integralOfChidt += dt * chi;} - - Molecule* myMolecules; - Atom** myAtoms; - - // chi and eta are the propagated degrees of freedom - - double chi; - double eta; - double NkBT; - double integralOfChidt; - - // targetTemp, targetPressure, and tauBarostat must be set. - // One of qmass or tauThermostat must be set; - - double targetTemp; - double targetPressure; - double tauThermostat; - double tauBarostat; - - short int have_tau_thermostat, have_tau_barostat, have_target_temp; - short int have_target_pressure; - double chiTolerance; - short int have_chi_tolerance; - double posIterTolerance; - short int have_pos_iter_tolerance; - -}; - template class NPTzm : public T{ public: @@ -369,61 +309,26 @@ template class NPTf : public T{ (public) NPTf ( SimInfo *theInfo, ForceFields* the_ff); virtual ~NPTf(); - virtual void integrateStep( int calcPot, int calcStress ){ - calcStress = 1; - T::integrateStep( calcPot, calcStress ); - } - virtual double getConservedQuantity(void); + virtual void resetIntegrator(void); - void setTauThermostat(double tt) {tauThermostat = tt; have_tau_thermostat=1;} - void setTauBarostat(double tb) {tauBarostat = tb; have_tau_barostat=1;} - void setTargetTemp(double tt) {targetTemp = tt; have_target_temp = 1;} - void setTargetPressure(double tp) {targetPressure = tp; have_target_pressure = 1;} - void setChiTolerance(double tol) {chiTolerance = tol;} - void setPosIterTolerance(double tol) {posIterTolerance = tol;} - protected: - virtual void moveA( void ); - virtual void moveB( void ); + virtual void evolveEtaA(void); + virtual void evolveEtaB(void); - virtual void resetIntegrator( void ); + virtual bool etaConverged( void ); - virtual int readyCheck(); + virtual void scaleSimBox( void ); + virtual void getVelScaleA( double sc[3], double vel[3] ); + virtual void getVelScaleB( double sc[3], int index ); + virtual void getPosScale(double pos[3], double COM[3], + int index, double sc[3]); - // chi and eta are the propagated degrees of freedom - - double chi; double eta[3][3]; - double NkBT; - double fkBT; - - int Nparticles; - - double *oldPos; - double *oldVel; - double *oldJi; - - double integralOfChidt; - - // targetTemp, targetPressure, and tauBarostat must be set. - // One of qmass or tauThermostat must be set; - - double targetTemp; - double targetPressure; - double tauThermostat; - double tauBarostat; - - short int have_tau_thermostat, have_tau_barostat, have_target_temp; - short int have_target_pressure; - double chiTolerance; - short int have_chi_tolerance; - double posIterTolerance; - short int have_pos_iter_tolerance; - double etaTolerance; - short int have_eta_tolerance; + double oldEta[3][3]; + double prevEta[3][3]; }; template class NPTxym : public T{