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 763 by tim, Mon Sep 15 16:52:02 2003 UTC vs.
Revision 780 by mmeineke, Mon Sep 22 21:23:25 2003 UTC

# Line 30 | Line 30 | template<typename T = BaseIntegrator> class Integrator
30    virtual double  getConservedQuantity(void);
31  
32   protected:
33 <  
33 >
34    virtual void integrateStep( int calcPot, int calcStress );
35    virtual void preMove( void );
36    virtual void moveA( void );
# Line 44 | Line 44 | template<typename T = BaseIntegrator> class Integrator
44    virtual void calcForce( int calcPot, int calcStress );  
45    virtual void thermalize();
46    
47 +  virtual void rotationPropagation( DirectionalAtom* dAtom, double ji[3] );
48 +
49    void checkConstraints( void );
50    void rotate( int axes1, int axes2, double angle, double j[3],
51           double A[3][3] );
# Line 135 | Line 137 | template<typename T> class NPTi : public T{
137  
138  
139  
140 < template<typename T> class NPTi : public T{
140 > template<typename T> class NPT : public T{
141  
142   public:
143  
144 <  NPTi ( SimInfo *theInfo, ForceFields* the_ff);
145 <  virtual ~NPTi();
144 >  NPT ( SimInfo *theInfo, ForceFields* the_ff);
145 >  virtual ~NPT();
146    
147    virtual void integrateStep( int calcPot, int calcStress ){
148      calcStress = 1;
149      T::integrateStep( calcPot, calcStress );
148    /* accIntegralOfChidt(); */
150    }
151  
152 <  virtual double getConservedQuantity(void);
152 >  virtual double getConservedQuantity(void) = 0;
153  
154    void setTauThermostat(double tt) {tauThermostat = tt; have_tau_thermostat=1;}
155    void setTauBarostat(double tb) {tauBarostat = tb; have_tau_barostat=1;}
# Line 167 | Line 168 | template<typename T> class NPTi : public T{ (protected
168  
169    virtual void resetIntegrator( void );
170  
171 +  virtual void getVelScaleA( double sc[3], double vel[3] ) = 0;
172 +  virtual void getVelScaleB( double sc[3], int index ) = 0;
173 +  virtual void getPosScale(double pos[3], double COM[3],
174 +                           int index, double sc[3]) = 0;
175 +
176 +  virtual bool chiConverged( void );
177 +  virtual bool etaConverged( void ) = 0;
178 +  
179 +  virtual void evolveChiA( void );
180 +  virtual void evolveEtaA( void ) = 0;
181 +  virtual void evolveChiB( void );
182 +  virtual void evolveEtaB( void ) = 0;
183 +
184 +  virtual void scaleSimBox( void ) = 0;
185 +
186    void accIntegralOfChidt(void) { integralOfChidt += dt * chi;}
187  
188    // chi and eta are the propagated degrees of freedom
189  
190 +  double oldChi;
191 +  double prevChi;
192    double chi;
175  double eta;
193    double NkBT;
194    double fkBT;
195  
196 +  double tt2, tb2;
197 +  double instaTemp, instaPress, instaVol;
198 +  double press[3][3];
199 +
200    int Nparticles;
201  
202    double integralOfChidt;
# Line 202 | Line 223 | template<typename T> class NPTi : public T{ (protected
223    double etaTolerance;
224    short int have_eta_tolerance;
225  
205  double volume;
206
226   };
227  
228 < template<typename T> class NPTim : public T{
229 <
228 > template<typename T> class NPTi : public T{
229 >  
230   public:
231 +  NPTi( SimInfo *theInfo, ForceFields* the_ff);
232 +  ~NPTi();
233  
213  NPTim ( SimInfo *theInfo, ForceFields* the_ff);
214  virtual ~NPTim() {}
215
216  virtual void integrateStep( int calcPot, int calcStress ){
217    calcStress = 1;
218    T::integrateStep( calcPot, calcStress );
219    accIntegralOfChidt();  
220  }
221
234    virtual double getConservedQuantity(void);
235 +  virtual void resetIntegrator(void);
236  
224  void setTauThermostat(double tt) {tauThermostat = tt; have_tau_thermostat=1;}
225  void setTauBarostat(double tb) {tauBarostat = tb; have_tau_barostat=1;}
226  void setTargetTemp(double tt) {targetTemp = tt; have_target_temp = 1;}
227  void setTargetPressure(double tp) {targetPressure = tp; have_target_pressure = 1;}
228  void setChiTolerance(double tol) {chiTolerance = tol;}
229  void setPosIterTolerance(double tol) {posIterTolerance = tol;}
230
237   protected:
238  
239 <  virtual void moveA( void );
234 <  virtual void moveB( void );
239 >
240  
241 <  virtual int readyCheck();
241 >  virtual void evolveEtaA(void);
242 >  virtual void evolveEtaB(void);
243  
244 <  virtual void resetIntegrator( void );
244 >  virtual bool etaConverged( void );
245  
246 <  void accIntegralOfChidt(void) { integralOfChidt += dt * chi;}
241 <  
242 <  Molecule* myMolecules;
243 <  Atom** myAtoms;
246 >  virtual void scaleSimBox( void );
247  
248 <  // chi and eta are the propagated degrees of freedom
249 <
250 <  double chi;
251 <  double eta;
249 <  double NkBT;
250 <  double integralOfChidt;
251 <
252 <  // targetTemp, targetPressure, and tauBarostat must be set.  
253 <  // One of qmass or tauThermostat must be set;
248 >  virtual void getVelScaleA( double sc[3], double vel[3] );
249 >  virtual void getVelScaleB( double sc[3], int index );
250 >  virtual void getPosScale(double pos[3], double COM[3],
251 >                           int index, double sc[3]);
252  
253 <  double targetTemp;
256 <  double targetPressure;
257 <  double tauThermostat;
258 <  double tauBarostat;
259 <
260 <  short int have_tau_thermostat, have_tau_barostat, have_target_temp;
261 <  short int have_target_pressure;
262 <  double chiTolerance;
263 <  short int have_chi_tolerance;
264 <  double posIterTolerance;
265 <  short int have_pos_iter_tolerance;
266 <
253 >  double eta, oldEta, prevEta;
254   };
255  
256   template<typename T> class NPTzm : public T{
# Line 320 | Line 307 | template<typename T> class NPTf : public T{ (public)
307   public:
308  
309    NPTf ( SimInfo *theInfo, ForceFields* the_ff);
310 <  virtual ~NPTf() {};
310 >  virtual ~NPTf();
311  
325  virtual void integrateStep( int calcPot, int calcStress ){
326    calcStress = 1;
327    T::integrateStep( calcPot, calcStress );
328    accIntegralOfChidt();
329  }
330  
312    virtual double getConservedQuantity(void);
313 +  virtual void resetIntegrator(void);
314  
333  void setTauThermostat(double tt) {tauThermostat = tt; have_tau_thermostat=1;}
334  void setTauBarostat(double tb) {tauBarostat = tb; have_tau_barostat=1;}
335  void setTargetTemp(double tt) {targetTemp = tt; have_target_temp = 1;}
336  void setTargetPressure(double tp) {targetPressure = tp; have_target_pressure = 1;}
337  void setChiTolerance(double tol) {chiTolerance = tol;}
338  void setPosIterTolerance(double tol) {posIterTolerance = tol;}
339
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 void scaleSimBox( void );
323  
324 <  virtual int readyCheck();
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  
349  void accIntegralOfChidt(void) { integralOfChidt += dt * chi;}
350
351  // chi and eta are the propagated degrees of freedom
352
353  double chi;
329    double eta[3][3];
330 <  double NkBT;
331 <
357 <  double integralOfChidt;
358 <  
359 <  // targetTemp, targetPressure, and tauBarostat must be set.  
360 <  // One of qmass or tauThermostat must be set;
361 <
362 <  double targetTemp;
363 <  double targetPressure;
364 <  double tauThermostat;
365 <  double tauBarostat;
366 <
367 <  short int have_tau_thermostat, have_tau_barostat, have_target_temp;
368 <  short int have_target_pressure;
369 <  double chiTolerance;
370 <  short int have_chi_tolerance;
371 <  double posIterTolerance;
372 <  short int have_pos_iter_tolerance;
373 <
330 >  double oldEta[3][3];
331 >  double prevEta[3][3];
332   };
333  
334   template<typename T> class NPTxym : public T{

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines