ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/Integrator.hpp
(Generate patch)

Comparing trunk/OOPSE/libmdtools/Integrator.hpp (file contents):
Revision 560 by gezelter, Fri Jun 20 16:49:33 2003 UTC vs.
Revision 594 by mmeineke, Fri Jul 11 22:34:48 2003 UTC

# Line 9 | Line 9 | class Integrator : public BaseIntegrator {
9   #include "Thermo.hpp"
10   #include "ReadWrite.hpp"
11  
12 + const double kB = 8.31451e-7;// boltzmann constant amu*Ang^2*fs^-2/K
13 + const double eConvert = 4.184e-4; // converts kcal/mol -> amu*A^2/fs^2
14 + const double p_convert = 1.63882576e8; //converts amu*fs^-2*Ang^-1 -> atm
15 + const int maxIteration = 300;
16 + const double tol = 1.0e-6;
17 +
18   class Integrator : public BaseIntegrator {
19  
20   public:
21 <  Integrator( SimInfo &theInfo, ForceFields* the_ff );
21 >  Integrator( SimInfo *theInfo, ForceFields* the_ff );
22    virtual ~Integrator();
23    void integrate( void );
24  
# Line 50 | Line 56 | class Integrator : public BaseIntegrator { (protected)
56    
57    int* moving; // tells whether we are moving atom i
58    int* moved;  // tells whether we have moved atom i
59 <  double* prePos; // pre constrained positions
59 >  double* oldPos; // pre constrained positions
60  
61    short isFirst; /*boolean for the first time integrate is called */
62    
63    double dt;
64    double dt2;
65  
60  const double kB = 8.31451e-7;     // boltzmann constant in amu*Ang^2*fs^-2/K
61  const double eConvert = 4.184e-4; // converts kcal/mol -> amu*A^2/fs^2
62  const int maxIteration = 300;
63  const double tol = 1.0e-6;
64  
66    double* pos;
67    double* vel;
68    double* frc;
# Line 76 | Line 77 | class NVE : public Integrator{
77  
78   class NVE : public Integrator{
79  
80 <  NVE ( void ):
80 > public:
81 >  NVE ( SimInfo *theInfo, ForceFields* the_ff ):
82      Integrator( theInfo, the_ff ){}
83    virtual ~NVE(){}
84  
# Line 88 | Line 90 | class NVT : public Integrator{ (public)
90  
91   public:
92  
93 <  NVT ( SimInfo &theInfo, ForceFields* the_ff) :
94 <    Integrator( theInfo, the_ff );
93 <  virtual ~NVT();
93 >  NVT ( SimInfo *theInfo, ForceFields* the_ff);
94 >  virtual ~NVT() {}
95  
95  void setQmass(double q) {qmass = q; have_qmass = 1;}
96    void setTauThermostat(double tt) {tauThermostat = tt; have_tau_thermostat=1;}
97    void setTargetTemp(double tt) {targetTemp = tt; have_target_temp = 1;}
98  
99   protected:
100  
101 <  virtual moveA( void );
102 <  virtual moveB( void );
101 >  virtual void moveA( void );
102 >  virtual void moveB( void );
103  
104 <  int readyCheck();
104 >  virtual int readyCheck();
105  
106 <  Atom** atoms;
106 >  // chi is a propagated degree of freedom.
107  
108 <  // zeta is a propagated degree of freedom.
108 >  double chi;
109  
110 <  double zeta;
110 >  // targetTemp must be set.  tauThermostat must also be set;
111  
112  // targetTemp must be set.  One of qmass or tauThermostat must be set;
113
114  double qmass;
112    double targetTemp;
113    double tauThermostat;
114 +  
115 +  short int have_tau_thermostat, have_target_temp;
116  
118  short int have_tau_thermostat, have_target_temp, have_qmass;
119
117   };
118  
119  
120 < class NPT : public Integrator{
120 > class NPTi : public Integrator{
121  
122   public:
123  
124 <  NPT ( SimInfo &theInfo, ForceFields* the_ff) :
125 <    Integrator( theInfo, the_ff );
129 <  virtual ~NPT();
124 >  NPTi ( SimInfo *theInfo, ForceFields* the_ff);
125 >  virtual ~NPTi() {};
126  
127 <  void setQmass(double q) {qmass = q; have_qmass = 1;}
127 >  virtual void integrateStep( int calcPot, int calcStress ){
128 >    calcStress = 1;
129 >    Integrator::integrateStep( calcPot, calcStress );
130 >  }
131 >
132    void setTauThermostat(double tt) {tauThermostat = tt; have_tau_thermostat=1;}
133    void setTauBarostat(double tb) {tauBarostat = tb; have_tau_barostat=1;}
134    void setTargetTemp(double tt) {targetTemp = tt; have_target_temp = 1;}
# Line 136 | Line 136 | class NPT : public Integrator{ (protected)
136  
137   protected:
138  
139 <  virtual moveA( void );
140 <  virtual moveB( void );
139 >  virtual void  moveA( void );
140 >  virtual void moveB( void );
141  
142 <  int readyCheck();
142 >  virtual int readyCheck();
143  
144 <  Atom** atoms;
144 >  // chi and eta are the propagated degrees of freedom
145  
146 <  // zeta and epsilonDot are the propagated degrees of freedom.
146 >  double chi;
147 >  double eta;
148 >  double NkBT;
149  
150 <  double zeta;
151 <  double epsilonDot;
150 >  // targetTemp, targetPressure, and tauBarostat must be set.  
151 >  // One of qmass or tauThermostat must be set;
152  
153 +  double targetTemp;
154 +  double targetPressure;
155 +  double tauThermostat;
156 +  double tauBarostat;
157 +
158 +  short int have_tau_thermostat, have_tau_barostat, have_target_temp;
159 +  short int have_target_pressure;
160 +
161 + };
162 +
163 + class NPTf : public Integrator{
164 +
165 + public:
166 +
167 +  NPTf ( SimInfo *theInfo, ForceFields* the_ff);
168 +  virtual ~NPTf() {};
169 +
170 +  virtual void integrateStep( int calcPot, int calcStress ){
171 +    calcStress = 1;
172 +    Integrator::integrateStep( calcPot, calcStress );
173 +  }
174 +
175 +  void setTauThermostat(double tt) {tauThermostat = tt; have_tau_thermostat=1;}
176 +  void setTauBarostat(double tb) {tauBarostat = tb; have_tau_barostat=1;}
177 +  void setTargetTemp(double tt) {targetTemp = tt; have_target_temp = 1;}
178 +  void setTargetPressure(double tp) {targetPressure = tp; have_target_pressure = 1;}
179 +
180 + protected:
181 +
182 +  virtual void  moveA( void );
183 +  virtual void moveB( void );
184 +
185 +  virtual int readyCheck();
186 +
187 +  // chi and eta are the propagated degrees of freedom
188 +
189 +  double chi;
190 +  double eta[3][3];
191 +  double NkBT;
192 +
193    // targetTemp, targetPressure, and tauBarostat must be set.  
194    // One of qmass or tauThermostat must be set;
195  
154  double qmass;
196    double targetTemp;
197    double targetPressure;
198    double tauThermostat;
199    double tauBarostat;
200  
201    short int have_tau_thermostat, have_tau_barostat, have_target_temp;
202 <  short int have_target_pressure, have_qmass;
202 >  short int have_target_pressure;
203  
204   };
205  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines