--- trunk/OOPSE/libmdtools/Integrator.hpp 2003/06/24 22:51:57 565 +++ trunk/OOPSE/libmdtools/Integrator.hpp 2003/07/11 22:34:48 594 @@ -11,6 +11,7 @@ const int maxIteration = 300; const double kB = 8.31451e-7;// boltzmann constant amu*Ang^2*fs^-2/K const double eConvert = 4.184e-4; // converts kcal/mol -> amu*A^2/fs^2 +const double p_convert = 1.63882576e8; //converts amu*fs^-2*Ang^-1 -> atm const int maxIteration = 300; const double tol = 1.0e-6; @@ -34,7 +35,7 @@ class Integrator : public BaseIntegrator { (protected) void checkConstraints( void ); void rotate( int axes1, int axes2, double angle, double j[3], - double A[9] ); + double A[3][3] ); ForceFields* myFF; @@ -116,13 +117,18 @@ class NPT : public Integrator{ }; -class NPT : public Integrator{ +class NPTi : public Integrator{ public: - NPT ( SimInfo *theInfo, ForceFields* the_ff); - virtual ~NPT() {}; + NPTi ( SimInfo *theInfo, ForceFields* the_ff); + virtual ~NPTi() {}; + virtual void integrateStep( int calcPot, int calcStress ){ + calcStress = 1; + Integrator::integrateStep( calcPot, calcStress ); + } + 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;} @@ -139,6 +145,7 @@ class NPT : public Integrator{ (protected) double chi; double eta; + double NkBT; // targetTemp, targetPressure, and tauBarostat must be set. // One of qmass or tauThermostat must be set; @@ -153,4 +160,47 @@ class NPT : public Integrator{ (protected) }; +class NPTf : public Integrator{ + +public: + + NPTf ( SimInfo *theInfo, ForceFields* the_ff); + virtual ~NPTf() {}; + + virtual void integrateStep( int calcPot, int calcStress ){ + calcStress = 1; + Integrator::integrateStep( calcPot, calcStress ); + } + + 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;} + +protected: + + virtual void moveA( void ); + virtual void moveB( void ); + + virtual int readyCheck(); + + // chi and eta are the propagated degrees of freedom + + double chi; + double eta[3][3]; + double NkBT; + + // 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; + +}; + #endif