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 755 by mmeineke, Tue Sep 9 20:35:25 2003 UTC vs.
Revision 767 by tim, Tue Sep 16 20:02:11 2003 UTC

# Line 27 | Line 27 | template<typename T = BaseIntegrator> class Integrator
27    Integrator( SimInfo *theInfo, ForceFields* the_ff );
28    virtual ~Integrator();
29    void integrate( void );
30 +  virtual double  getConservedQuantity(void);
31  
31
32   protected:
33    
34    virtual void integrateStep( int calcPot, int calcStress );
# Line 40 | Line 40 | template<typename T = BaseIntegrator> class Integrator
40    virtual int  readyCheck( void ) { return 1; }
41  
42    virtual void resetIntegrator( void ) { }
43 <
43 >
44    virtual void calcForce( int calcPot, int calcStress );  
45    virtual void thermalize();
46    
# Line 95 | Line 95 | template<typename T> class NVT : public T { (public)
95   public:
96  
97    NVT ( SimInfo *theInfo, ForceFields* the_ff);
98 <  virtual ~NVT() {}
98 >  virtual ~NVT();
99  
100    void setTauThermostat(double tt) {tauThermostat = tt; have_tau_thermostat=1;}
101    void setTargetTemp(double tt) {targetTemp = tt; have_target_temp = 1;}
102 +  void setChiTolerance(double tol) {chiTolerance = tol;}
103 +  virtual double  getConservedQuantity(void);
104  
105   protected:
106  
# Line 113 | Line 115 | template<typename T> class NVT : public T { (public)
115  
116    double chi;
117  
118 +  //integral of chi(t)dt
119 +  double integralOfChidt;
120 +
121    // targetTemp must be set.  tauThermostat must also be set;
122  
123    double targetTemp;
# Line 120 | Line 125 | template<typename T> class NVT : public T { (public)
125    
126    short int have_tau_thermostat, have_target_temp;
127  
128 +  double *oldVel;
129 +  double *oldJi;
130 +
131 +  double chiTolerance;
132 +  short int have_chi_tolerance;
133 +
134   };
135  
136  
# Line 129 | Line 140 | template<typename T> class NPTi : public T{ (public)
140   public:
141  
142    NPTi ( SimInfo *theInfo, ForceFields* the_ff);
143 <  virtual ~NPTi() {};
144 <
143 >  virtual ~NPTi();
144 >  
145    virtual void integrateStep( int calcPot, int calcStress ){
146      calcStress = 1;
147      T::integrateStep( calcPot, calcStress );
148 +    /* accIntegralOfChidt(); */
149    }
150  
151 +  virtual double getConservedQuantity(void);
152 +
153    void setTauThermostat(double tt) {tauThermostat = tt; have_tau_thermostat=1;}
154    void setTauBarostat(double tb) {tauBarostat = tb; have_tau_barostat=1;}
155    void setTargetTemp(double tt) {targetTemp = tt; have_target_temp = 1;}
156    void setTargetPressure(double tp) {targetPressure = tp; have_target_pressure = 1;}
157 +  void setChiTolerance(double tol) {chiTolerance = tol; have_chi_tolerance = 1;}
158 +  void setPosIterTolerance(double tol) {posIterTolerance = tol; have_pos_iter_tolerance = 1;}
159 +  void setEtaTolerance(double tol) {etaTolerance = tol; have_eta_tolerance = 1;}
160  
161   protected:
162  
# Line 150 | Line 167 | template<typename T> class NPTi : public T{ (public)
167  
168    virtual void resetIntegrator( void );
169  
170 +  void accIntegralOfChidt(void) { integralOfChidt += dt * chi;}
171 +
172    // chi and eta are the propagated degrees of freedom
173  
174    double chi;
175    double eta;
176    double NkBT;
177 +  double fkBT;
178  
179 +  int Nparticles;
180 +
181 +  double integralOfChidt;
182 +
183    // targetTemp, targetPressure, and tauBarostat must be set.  
184    // One of qmass or tauThermostat must be set;
185  
# Line 167 | Line 191 | template<typename T> class NPTi : public T{ (public)
191    short int have_tau_thermostat, have_tau_barostat, have_target_temp;
192    short int have_target_pressure;
193  
194 +  double *oldPos;
195 +  double *oldVel;
196 +  double *oldJi;
197 +
198 +  double chiTolerance;
199 +  short int have_chi_tolerance;
200 +  double posIterTolerance;
201 +  short int have_pos_iter_tolerance;
202 +  double etaTolerance;
203 +  short int have_eta_tolerance;
204 +
205   };
206  
207   template<typename T> class NPTim : public T{
# Line 174 | Line 209 | template<typename T> class NPTim : public T{ (public)
209   public:
210  
211    NPTim ( SimInfo *theInfo, ForceFields* the_ff);
212 <  virtual ~NPTim() {};
212 >  virtual ~NPTim() {}
213  
214    virtual void integrateStep( int calcPot, int calcStress ){
215      calcStress = 1;
216      T::integrateStep( calcPot, calcStress );
217 +    accIntegralOfChidt();  
218    }
219  
220 +  virtual double getConservedQuantity(void);
221 +
222    void setTauThermostat(double tt) {tauThermostat = tt; have_tau_thermostat=1;}
223    void setTauBarostat(double tb) {tauBarostat = tb; have_tau_barostat=1;}
224    void setTargetTemp(double tt) {targetTemp = tt; have_target_temp = 1;}
225    void setTargetPressure(double tp) {targetPressure = tp; have_target_pressure = 1;}
226 +  void setChiTolerance(double tol) {chiTolerance = tol;}
227 +  void setPosIterTolerance(double tol) {posIterTolerance = tol;}
228  
229   protected:
230  
# Line 195 | Line 235 | template<typename T> class NPTim : public T{ (public)
235  
236    virtual void resetIntegrator( void );
237  
238 +  void accIntegralOfChidt(void) { integralOfChidt += dt * chi;}
239 +  
240    Molecule* myMolecules;
241    Atom** myAtoms;
242  
# Line 203 | Line 245 | template<typename T> class NPTim : public T{ (public)
245    double chi;
246    double eta;
247    double NkBT;
248 +  double integralOfChidt;
249  
250    // targetTemp, targetPressure, and tauBarostat must be set.  
251    // One of qmass or tauThermostat must be set;
# Line 214 | Line 257 | template<typename T> class NPTim : public T{ (public)
257  
258    short int have_tau_thermostat, have_tau_barostat, have_target_temp;
259    short int have_target_pressure;
260 +  double chiTolerance;
261 +  short int have_chi_tolerance;
262 +  double posIterTolerance;
263 +  short int have_pos_iter_tolerance;
264  
265   };
266  
# Line 271 | Line 318 | template<typename T> class NPTf : public T{ (public)
318   public:
319  
320    NPTf ( SimInfo *theInfo, ForceFields* the_ff);
321 <  virtual ~NPTf() {};
321 >  virtual ~NPTf();
322  
323    virtual void integrateStep( int calcPot, int calcStress ){
324      calcStress = 1;
325      T::integrateStep( calcPot, calcStress );
326    }
327 +  
328 +  virtual double getConservedQuantity(void);
329  
330    void setTauThermostat(double tt) {tauThermostat = tt; have_tau_thermostat=1;}
331    void setTauBarostat(double tb) {tauBarostat = tb; have_tau_barostat=1;}
332    void setTargetTemp(double tt) {targetTemp = tt; have_target_temp = 1;}
333    void setTargetPressure(double tp) {targetPressure = tp; have_target_pressure = 1;}
334 +  void setChiTolerance(double tol) {chiTolerance = tol;}
335 +  void setPosIterTolerance(double tol) {posIterTolerance = tol;}
336  
337   protected:
338  
# Line 292 | Line 343 | template<typename T> class NPTf : public T{ (public)
343  
344    virtual int readyCheck();
345  
346 +
347    // chi and eta are the propagated degrees of freedom
348  
349    double chi;
350    double eta[3][3];
351    double NkBT;
352 +  double fkBT;
353  
354 +  int Nparticles;
355 +
356 +  double *oldPos;
357 +  double *oldVel;
358 +  double *oldJi;
359 +
360 +  double integralOfChidt;
361 +  
362    // targetTemp, targetPressure, and tauBarostat must be set.  
363    // One of qmass or tauThermostat must be set;
364  
# Line 308 | Line 369 | template<typename T> class NPTf : public T{ (public)
369  
370    short int have_tau_thermostat, have_tau_barostat, have_target_temp;
371    short int have_target_pressure;
372 <
372 >  double chiTolerance;
373 >  short int have_chi_tolerance;
374 >  double posIterTolerance;
375 >  short int have_pos_iter_tolerance;
376 >  double etaTolerance;
377 >  short int have_eta_tolerance;
378   };
379  
380   template<typename T> class NPTxym : public T{
# Line 372 | Line 438 | template<typename T> class NPTfm : public T{ (public)
438    virtual void integrateStep( int calcPot, int calcStress ){
439      calcStress = 1;
440      T::integrateStep( calcPot, calcStress );
441 +    accIntegralOfChidt();
442    }
443  
444 +  virtual double getConservedQuantity(void);
445 +  
446    void setTauThermostat(double tt) {tauThermostat = tt; have_tau_thermostat=1;}
447    void setTauBarostat(double tb) {tauBarostat = tb; have_tau_barostat=1;}
448    void setTargetTemp(double tt) {targetTemp = tt; have_target_temp = 1;}
449    void setTargetPressure(double tp) {targetPressure = tp; have_target_pressure = 1;}
450 +  void setChiTolerance(double tol) {chiTolerance = tol;}
451 +  void setPosIterTolerance(double tol) {posIterTolerance = tol;}
452  
453   protected:
454  
# Line 388 | Line 459 | template<typename T> class NPTfm : public T{ (public)
459  
460    virtual int readyCheck();
461  
462 +  void accIntegralOfChidt(void) { integralOfChidt += dt * chi;}
463 +
464    Molecule* myMolecules;
465    Atom** myAtoms;
466  
# Line 396 | Line 469 | template<typename T> class NPTfm : public T{ (public)
469    double chi;
470    double eta[3][3];
471    double NkBT;
472 +  double integralOfChidt;
473  
474    // targetTemp, targetPressure, and tauBarostat must be set.  
475    // One of qmass or tauThermostat must be set;
# Line 407 | Line 481 | template<typename T> class NPTfm : public T{ (public)
481  
482    short int have_tau_thermostat, have_tau_barostat, have_target_temp;
483    short int have_target_pressure;
484 +  double chiTolerance;
485 +  short int have_chi_tolerance;
486 +  double posIterTolerance;
487 +  short int have_pos_iter_tolerance;
488  
489   };
490  
# Line 427 | Line 505 | template<typename T> class NPTpr : public T{ (public)
505    void setTauBarostat(double tb) {tauBarostat = tb; have_tau_barostat=1;}
506    void setTargetTemp(double tt) {targetTemp = tt; have_target_temp = 1;}
507    void setTargetPressure(double tp) {targetPressure = tp; have_target_pressure = 1;}
508 +  void setChiTolerance(double tol) {chiTolerance = tol;}
509 +  void setPosIterTolerance(double tol) {posIterTolerance = tol;}
510  
511   protected:
512  
# Line 453 | Line 533 | template<typename T> class NPTpr : public T{ (public)
533  
534    short int have_tau_thermostat, have_tau_barostat, have_target_temp;
535    short int have_target_pressure;
536 +  double chiTolerance;
537 +  short int have_chi_tolerance;
538 +  double posIterTolerance;
539 +  short int have_pos_iter_tolerance;
540  
541   };
542  
# Line 485 | Line 569 | template<typename T> class ZConstraint : public T {
569        virtual double getHFOfUnconsMols(Atom* atom, double totalForce);
570      
571      private:
572 <    int totNumOfMovingAtoms;
572 >      int totNumOfMovingAtoms;
573    };
574  
575    class PolicyByMass : public ForceSubtractionPolicy{

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines