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 701 by tim, Wed Aug 20 14:34:04 2003 UTC vs.
Revision 747 by gezelter, Fri Sep 5 21:28:52 2003 UTC

# Line 39 | Line 39 | template<typename T = BaseIntegrator> class Integrator
39    virtual void constrainB( void );
40    virtual int  readyCheck( void ) { return 1; }
41  
42 +  virtual void resetIntegrator( void ) { }
43 +
44    virtual void calcForce( int calcPot, int calcStress );  
45    virtual void thermalize();
46    
# Line 105 | Line 107 | template<typename T> class NVT : public T { (protected
107  
108    virtual int readyCheck();
109  
110 +  virtual void resetIntegrator( void );
111 +
112    // chi is a propagated degree of freedom.
113  
114    double chi;
# Line 144 | Line 148 | template<typename T> class NPTi : public T{ (protected
148  
149    virtual int readyCheck();
150  
151 +  virtual void resetIntegrator( void );
152 +
153    // chi and eta are the propagated degrees of freedom
154  
155    double chi;
# Line 187 | Line 193 | template<typename T> class NPTim : public T{ (protecte
193  
194    virtual int readyCheck();
195  
196 +  virtual void resetIntegrator( void );
197 +
198    Molecule* myMolecules;
199    Atom** myAtoms;
200  
# Line 230 | Line 238 | template<typename T> class NPTf : public T{ (protected
238  
239    virtual void  moveA( void );
240    virtual void moveB( void );
241 +
242 +  virtual void resetIntegrator( void );
243  
244    virtual int readyCheck();
245  
# Line 274 | Line 284 | template<typename T> class NPTfm : public T{ (protecte
284    virtual void  moveA( void );
285    virtual void moveB( void );
286  
287 +  virtual void resetIntegrator( void );
288 +
289    virtual int readyCheck();
290  
291    Molecule* myMolecules;
# Line 298 | Line 310 | template<typename T> class ZConstraint : public T {
310  
311   };
312  
313 +
314 + template<typename T> class NPTpr : public T{
315 +
316 + public:
317 +
318 +  NPTpr ( SimInfo *theInfo, ForceFields* the_ff);
319 +  virtual ~NPTpr() {};
320 +
321 +  virtual void integrateStep( int calcPot, int calcStress ){
322 +    calcStress = 1;
323 +    T::integrateStep( calcPot, calcStress );
324 +  }
325 +
326 +  void setTauThermostat(double tt) {tauThermostat = tt; have_tau_thermostat=1;}
327 +  void setTauBarostat(double tb) {tauBarostat = tb; have_tau_barostat=1;}
328 +  void setTargetTemp(double tt) {targetTemp = tt; have_target_temp = 1;}
329 +  void setTargetPressure(double tp) {targetPressure = tp; have_target_pressure = 1;}
330 +
331 + protected:
332 +
333 +  virtual void  moveA( void );
334 +  virtual void moveB( void );
335 +
336 +  virtual int readyCheck();
337 +
338 +  virtual void resetIntegrator( void );
339 +
340 +  // chi and eta are the propagated degrees of freedom
341 +
342 +  double chi;
343 +  double eta[3][3];
344 +  double NkBT;
345 +
346 +  // targetTemp, targetPressure, and tauBarostat must be set.  
347 +  // One of qmass or tauThermostat must be set;
348 +
349 +  double targetTemp;
350 +  double targetPressure;
351 +  double tauThermostat;
352 +  double tauBarostat;
353 +
354 +  short int have_tau_thermostat, have_tau_barostat, have_target_temp;
355 +  short int have_target_pressure;
356 +
357 + };
358 +
359 +
360   template<typename T> class ZConstraint : public T {
361    
362    public:
363 <  class ForceSubstractionPolicy{
363 >  class ForceSubtractionPolicy{
364      public:
365 <      ForceSubstractionPolicy(ZConstraint<T>* integrator) {zconsIntegrator = integrator;}
365 >      ForceSubtractionPolicy(ZConstraint<T>* integrator) {zconsIntegrator = integrator;}
366  
367        virtual void update() = 0;    
368        virtual double getZFOfFixedZMols(Molecule* mol, Atom* atom, double totalForce) = 0;
# Line 315 | Line 374 | template<typename T> class ZConstraint : public T {
374       ZConstraint<T>* zconsIntegrator;;
375    };
376  
377 <  class PolicyByNumber : ForceSubstractionPolicy{
377 >  class PolicyByNumber : public ForceSubtractionPolicy{
378 >
379      public:
380 <      PolicyByNumber(ZConstraint<T>* integrator) :ForceSubstractionPolicy(integrator) {}    
380 >      PolicyByNumber(ZConstraint<T>* integrator) :ForceSubtractionPolicy(integrator) {}    
381        virtual void update();    
382        virtual double getZFOfFixedZMols(Molecule* mol, Atom* atom, double totalForce) ;
383        virtual double getZFOfMovingMols(Atom* atom, double totalForce) ;
# Line 328 | Line 388 | template<typename T> class ZConstraint : public T {
388      int totNumOfMovingAtoms;
389    };
390  
391 <  class PolicyByMass :ForceSubstractionPolicy{
391 >  class PolicyByMass : public ForceSubtractionPolicy{
392 >
393      public:
394 <      PolicyByMass(ZConstraint<T>* integrator) :ForceSubstractionPolicy(integrator) {}  
394 >      PolicyByMass(ZConstraint<T>* integrator) :ForceSubtractionPolicy(integrator) {}  
395        
396        virtual void update();    
397        virtual double getZFOfFixedZMols(Molecule* mol, Atom* atom, double totalForce) ;
# Line 422 | Line 483 | template<typename T> class ZConstraint : public T {
483    double calcSysCOMVel();
484    double calcTotalForce();
485    
486 <  ForceSubstractionPolicy* forcePolicy; //force substration policy
487 <  friend class ForceSubstractionPolicy;
486 >  ForceSubtractionPolicy* forcePolicy; //force subtraction policy
487 >  friend class ForceSubtractionPolicy;
488  
489   };
490  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines