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 780 by mmeineke, Mon Sep 22 21:23:25 2003 UTC vs.
Revision 790 by mmeineke, Mon Sep 29 21:16:11 2003 UTC

# Line 366 | Line 366 | template<typename T> class NPTxym : public T{ (protect
366    double eta;
367    double etaX;
368    double etaY;
369  double NkBT;
370
371  // targetTemp, targetPressure, and tauBarostat must be set.  
372  // One of qmass or tauThermostat must be set;
373
374  double targetTemp;
375  double targetPressure;
376  double tauThermostat;
377  double tauBarostat;
378
379  short int have_tau_thermostat, have_tau_barostat, have_target_temp;
380  short int have_target_pressure;
381
382 };
383
384
385 template<typename T> class NPTfm : public T{
386
387 public:
388
389  NPTfm ( SimInfo *theInfo, ForceFields* the_ff);
390  virtual ~NPTfm() {};
391
392  virtual void integrateStep( int calcPot, int calcStress ){
393    calcStress = 1;
394    T::integrateStep( calcPot, calcStress );
395    accIntegralOfChidt();
396  }
397
398  virtual double getConservedQuantity(void);
399  
400  void setTauThermostat(double tt) {tauThermostat = tt; have_tau_thermostat=1;}
401  void setTauBarostat(double tb) {tauBarostat = tb; have_tau_barostat=1;}
402  void setTargetTemp(double tt) {targetTemp = tt; have_target_temp = 1;}
403  void setTargetPressure(double tp) {targetPressure = tp; have_target_pressure = 1;}
404  void setChiTolerance(double tol) {chiTolerance = tol;}
405  void setPosIterTolerance(double tol) {posIterTolerance = tol;}
406
407 protected:
408
409  virtual void  moveA( void );
410  virtual void moveB( void );
411
412  virtual void resetIntegrator( void );
413
414  virtual int readyCheck();
415
416  void accIntegralOfChidt(void) { integralOfChidt += dt * chi;}
417
418  Molecule* myMolecules;
419  Atom** myAtoms;
420
421  // chi and eta are the propagated degrees of freedom
422
423  double chi;
424  double eta[3][3];
369    double NkBT;
426  double integralOfChidt;
370  
371    // targetTemp, targetPressure, and tauBarostat must be set.  
372    // One of qmass or tauThermostat must be set;
# Line 435 | Line 378 | template<typename T> class NPTfm : public T{ (protecte
378  
379    short int have_tau_thermostat, have_tau_barostat, have_target_temp;
380    short int have_target_pressure;
438  double chiTolerance;
439  short int have_chi_tolerance;
440  double posIterTolerance;
441  short int have_pos_iter_tolerance;
381  
382   };
383  
445
446 template<typename T> class NPTpr : public T{
447
448 public:
449
450  NPTpr ( SimInfo *theInfo, ForceFields* the_ff);
451  virtual ~NPTpr() {};
452
453  virtual void integrateStep( int calcPot, int calcStress ){
454    calcStress = 1;
455    T::integrateStep( calcPot, calcStress );
456  }
457
458  void setTauThermostat(double tt) {tauThermostat = tt; have_tau_thermostat=1;}
459  void setTauBarostat(double tb) {tauBarostat = tb; have_tau_barostat=1;}
460  void setTargetTemp(double tt) {targetTemp = tt; have_target_temp = 1;}
461  void setTargetPressure(double tp) {targetPressure = tp; have_target_pressure = 1;}
462  void setChiTolerance(double tol) {chiTolerance = tol;}
463  void setPosIterTolerance(double tol) {posIterTolerance = tol;}
464
465 protected:
466
467  virtual void  moveA( void );
468  virtual void moveB( void );
469
470  virtual int readyCheck();
471
472  virtual void resetIntegrator( void );
473
474  // chi and eta are the propagated degrees of freedom
475
476  double chi;
477  double eta[3][3];
478  double NkBT;
479
480  // targetTemp, targetPressure, and tauBarostat must be set.  
481  // One of qmass or tauThermostat must be set;
482
483  double targetTemp;
484  double targetPressure;
485  double tauThermostat;
486  double tauBarostat;
487
488  short int have_tau_thermostat, have_tau_barostat, have_target_temp;
489  short int have_target_pressure;
490  double chiTolerance;
491  short int have_chi_tolerance;
492  double posIterTolerance;
493  short int have_pos_iter_tolerance;
494
495 };
496
497
384   template<typename T> class ZConstraint : public T {
385    
386    public:
# Line 509 | Line 395 | template<typename T> class ZConstraint : public T {
395        virtual double getHFOfUnconsMols(Atom* atom, double totalForce) = 0;
396      
397     protected:
398 <     ZConstraint<T>* zconsIntegrator;;
398 >     ZConstraint<T>* zconsIntegrator;
399    };
400  
401    class PolicyByNumber : public ForceSubtractionPolicy{
# Line 562 | Line 448 | template<typename T> class ZConstraint : public T {
448    virtual void update();                      //which is called to indicate the molecules' migration
449   #endif
450  
451 +  enum ZConsState {zcsMoving, zcsFixed};  
452 +
453 +  vector<Molecule*> zconsMols;              //z-constraint molecules array
454 +  vector<ZConsState> states;                 //state of z-constraint molecules
455 +
456 +
457 +
458 +  int totNumOfUnconsAtoms;              //total number of uncontraint atoms
459 +  double totalMassOfUncons;                //total mas of unconstraint molecules
460 +
461 +
462   protected:
463  
464 <  enum ZConsState {zcsMoving, zcsFixed};  
464 >
465  
466    virtual void calcForce( int calcPot, int calcStress );
467    virtual void thermalize(void);
# Line 587 | Line 484 | template<typename T> class ZConstraint : public T {
484    double zForceConst;                           //base force constant term
485                                                            //which is estimate by OOPSE
486    
487 <  vector<Molecule*> zconsMols;              //z-constraint molecules array
487 >
488    vector<double> massOfZConsMols;       //mass of z-constraint molecule
489    vector<double> kz;                              //force constant array
490 <  vector<ZConsState> states;                 //state of z-constraint molecules
490 >
491    vector<double> zPos;                          //
492    
493    
494    vector<Molecule*> unconsMols;           //unconstraint molecules array
495    vector<double> massOfUnconsMols;    //mass array of unconstraint molecules
599  double totalMassOfUncons;                //total mas of unconstraint molecules
496  
497 +
498    vector<ZConsParaItem>* parameters; //
499    
500    vector<int> indexOfAllZConsMols;     //index of All Z-Constraint Molecuels
# Line 606 | Line 503 | template<typename T> class ZConstraint : public T {
503    double* fz;
504    double* curZPos;
505    
609  int totNumOfUnconsAtoms;              //total number of uncontraint atoms
506  
507 +
508    int whichDirection;                           //constraint direction
509    
510   private:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines