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 778 by mmeineke, Fri Sep 19 20:00:27 2003 UTC vs.
Revision 1097 by gezelter, Mon Apr 12 20:32:20 2004 UTC

# Line 4 | Line 4
4   #include <string>
5   #include <vector>
6   #include "Atom.hpp"
7 + #include "StuntDouble.hpp"
8   #include "Molecule.hpp"
9   #include "SRI.hpp"
10   #include "AbstractClasses.hpp"
# Line 20 | Line 21 | const double tol = 1.0e-6;
21   const int maxIteration = 300;
22   const double tol = 1.0e-6;
23  
23
24   template<typename T = BaseIntegrator> class Integrator : public T {
25  
26   public:
# Line 28 | Line 28 | template<typename T = BaseIntegrator> class Integrator
28    virtual ~Integrator();
29    void integrate( void );
30    virtual double  getConservedQuantity(void);
31 +  virtual string getAdditionalParameters(void);
32  
33   protected:
34  
# Line 40 | Line 41 | template<typename T = BaseIntegrator> class Integrator
41    virtual int  readyCheck( void ) { return 1; }
42  
43    virtual void resetIntegrator( void ) { }
44 <
45 <  virtual void calcForce( int calcPot, int calcStress );  
44 >
45 >  virtual void calcForce( int calcPot, int calcStress );
46    virtual void thermalize();
46  
47  virtual void rotationPropagation( DirectionalAtom* dAtom, double ji[3] );
47  
48 +  virtual void rotationPropagation( StuntDouble* sd, double ji[3] );
49 +
50    void checkConstraints( void );
51 <  void rotate( int axes1, int axes2, double angle, double j[3],
51 >  void rotate( int axes1, int axes2, double angle, double j[3],
52           double A[3][3] );
53 <        
53 >
54    ForceFields* myFF;
55  
56    SimInfo *info; // all the info we'll ever need
57 +  vector<StuntDouble*> integrableObjects;
58    int nAtoms;  /* the number of atoms */
59    int oldAtoms;
60    Atom **atoms; /* array of atom pointers */
# Line 61 | Line 63 | template<typename T = BaseIntegrator> class Integrator
63  
64    int isConstrained; // boolean to know whether the systems contains
65           // constraints.
66 <  int nConstrained;  // counter for number of constraints
67 <  int *constrainedA; // the i of a constraint pair
68 <  int *constrainedB; // the j of a constraint pair
69 <  double *constrainedDsqr; // the square of the constraint distance
70 <  
66 >  int nConstrained;  // counter for number of constraints
67 >  int *constrainedA; // the i of a constraint pair
68 >  int *constrainedB; // the j of a constraint pair
69 >  double *constrainedDsqr; // the square of the constraint distance
70 >
71    int* moving; // tells whether we are moving atom i
72    int* moved;  // tells whether we have moved atom i
73 <  double* oldPos; // pre constrained positions
73 >  double* oldPos; // pre constrained positions
74  
75    short isFirst; /*boolean for the first time integrate is called */
76 <  
76 >
77    double dt;
78    double dt2;
79  
80    Thermo *tStats;
81    StatWriter*  statOut;
82    DumpWriter*  dumpOut;
83 <  
83 >
84   };
85  
86   typedef Integrator<BaseIntegrator> RealIntegrator;
# Line 88 | Line 90 | template<typename T> class NVE : public T { (public)
90   public:
91    NVE ( SimInfo *theInfo, ForceFields* the_ff ):
92      T( theInfo, the_ff ){}
93 <  virtual ~NVE(){}  
93 >  virtual ~NVE(){}
94   };
95  
96  
# Line 103 | Line 105 | template<typename T> class NVT : public T { (public)
105    void setTargetTemp(double tt) {targetTemp = tt; have_target_temp = 1;}
106    void setChiTolerance(double tol) {chiTolerance = tol;}
107    virtual double  getConservedQuantity(void);
108 +  virtual string getAdditionalParameters(void);
109  
110   protected:
111  
# Line 124 | Line 127 | template<typename T> class NVT : public T { (public)
127  
128    double targetTemp;
129    double tauThermostat;
130 <  
130 >
131    short int have_tau_thermostat, have_target_temp;
132  
133    double *oldVel;
# Line 143 | Line 146 | template<typename T> class NPT : public T{ (public)
146  
147    NPT ( SimInfo *theInfo, ForceFields* the_ff);
148    virtual ~NPT();
149 <  
149 >
150    virtual void integrateStep( int calcPot, int calcStress ){
151      calcStress = 1;
152      T::integrateStep( calcPot, calcStress );
153    }
154  
155    virtual double getConservedQuantity(void) = 0;
156 +  virtual string getAdditionalParameters(void) = 0;
157 +  
158 +  double myTauThermo( void ) { return tauThermostat; }
159 +  double myTauBaro( void ) { return tauBarostat; }
160  
161    void setTauThermostat(double tt) {tauThermostat = tt; have_tau_thermostat=1;}
162    void setTauBarostat(double tb) {tauBarostat = tb; have_tau_barostat=1;}
# Line 170 | Line 177 | template<typename T> class NPT : public T{ (public)
177  
178    virtual void getVelScaleA( double sc[3], double vel[3] ) = 0;
179    virtual void getVelScaleB( double sc[3], int index ) = 0;
180 <  virtual void getPosScale(double pos[3], double COM[3],
180 >  virtual void getPosScale(double pos[3], double COM[3],
181                             int index, double sc[3]) = 0;
182  
183 +  virtual void calcVelScale( void ) = 0;
184 +
185    virtual bool chiConverged( void );
186    virtual bool etaConverged( void ) = 0;
187 <  
187 >
188    virtual void evolveChiA( void );
189    virtual void evolveEtaA( void ) = 0;
190    virtual void evolveChiB( void );
# Line 195 | Line 204 | template<typename T> class NPT : public T{ (public)
204  
205    double tt2, tb2;
206    double instaTemp, instaPress, instaVol;
207 +  double press[3][3];
208  
209    int Nparticles;
210  
211    double integralOfChidt;
212  
213 <  // targetTemp, targetPressure, and tauBarostat must be set.  
213 >  // targetTemp, targetPressure, and tauBarostat must be set.
214    // One of qmass or tauThermostat must be set;
215  
216    double targetTemp;
# Line 225 | Line 235 | template<typename T> class NPTi : public T{
235   };
236  
237   template<typename T> class NPTi : public T{
238 <  
238 >
239   public:
240    NPTi( SimInfo *theInfo, ForceFields* the_ff);
241    ~NPTi();
242  
243    virtual double getConservedQuantity(void);
244    virtual void resetIntegrator(void);
245 <
245 >  virtual string getAdditionalParameters(void);
246   protected:
247  
238
248  
249 +
250    virtual void evolveEtaA(void);
251    virtual void evolveEtaB(void);
252  
# Line 246 | Line 256 | template<typename T> class NPTi : public T{
256  
257    virtual void getVelScaleA( double sc[3], double vel[3] );
258    virtual void getVelScaleB( double sc[3], int index );
259 <  virtual void getPosScale(double pos[3], double COM[3],
259 >  virtual void getPosScale(double pos[3], double COM[3],
260                             int index, double sc[3]);
261  
262 +  virtual void calcVelScale( void );
263 +
264    double eta, oldEta, prevEta;
265 +  double vScale;
266   };
267  
268 + template<typename T> class NPTf : public T{
269  
256 template<typename T> class NPTim : public T{
257
270   public:
271  
272 <  NPTim ( SimInfo *theInfo, ForceFields* the_ff);
273 <  virtual ~NPTim() {}
262 <
263 <  virtual void integrateStep( int calcPot, int calcStress ){
264 <    calcStress = 1;
265 <    T::integrateStep( calcPot, calcStress );
266 <    accIntegralOfChidt();  
267 <  }
272 >  NPTf ( SimInfo *theInfo, ForceFields* the_ff);
273 >  virtual ~NPTf();
274  
275    virtual double getConservedQuantity(void);
276 +  virtual string getAdditionalParameters(void);
277 +  virtual void resetIntegrator(void);
278  
271  void setTauThermostat(double tt) {tauThermostat = tt; have_tau_thermostat=1;}
272  void setTauBarostat(double tb) {tauBarostat = tb; have_tau_barostat=1;}
273  void setTargetTemp(double tt) {targetTemp = tt; have_target_temp = 1;}
274  void setTargetPressure(double tp) {targetPressure = tp; have_target_pressure = 1;}
275  void setChiTolerance(double tol) {chiTolerance = tol;}
276  void setPosIterTolerance(double tol) {posIterTolerance = tol;}
277
279   protected:
280  
281 <  virtual void moveA( void );
282 <  virtual void moveB( void );
281 >  virtual void evolveEtaA(void);
282 >  virtual void evolveEtaB(void);
283  
284 <  virtual int readyCheck();
284 >  virtual bool etaConverged( void );
285  
286 <  virtual void resetIntegrator( void );
286 >  virtual void scaleSimBox( void );
287  
288 <  void accIntegralOfChidt(void) { integralOfChidt += dt * chi;}
289 <  
290 <  Molecule* myMolecules;
291 <  Atom** myAtoms;
288 >  virtual void getVelScaleA( double sc[3], double vel[3] );
289 >  virtual void getVelScaleB( double sc[3], int index );
290 >  virtual void getPosScale(double pos[3], double COM[3],
291 >                           int index, double sc[3]);
292  
293 <  // chi and eta are the propagated degrees of freedom
293 >  virtual void calcVelScale( void );
294  
295 <  double chi;
296 <  double eta;
297 <  double NkBT;
298 <  double integralOfChidt;
298 <
299 <  // targetTemp, targetPressure, and tauBarostat must be set.  
300 <  // One of qmass or tauThermostat must be set;
301 <
302 <  double targetTemp;
303 <  double targetPressure;
304 <  double tauThermostat;
305 <  double tauBarostat;
306 <
307 <  short int have_tau_thermostat, have_tau_barostat, have_target_temp;
308 <  short int have_target_pressure;
309 <  double chiTolerance;
310 <  short int have_chi_tolerance;
311 <  double posIterTolerance;
312 <  short int have_pos_iter_tolerance;
313 <
295 >  double eta[3][3];
296 >  double oldEta[3][3];
297 >  double prevEta[3][3];
298 >  double vScale[3][3];
299   };
300  
301 < template<typename T> class NPTzm : public T{
301 > template<typename T> class NPTxyz : public T{
302  
303   public:
304  
305 <  NPTzm ( SimInfo *theInfo, ForceFields* the_ff);
306 <  virtual ~NPTzm() {};
322 <
323 <  virtual void integrateStep( int calcPot, int calcStress ){
324 <    calcStress = 1;
325 <    T::integrateStep( calcPot, calcStress );
326 <  }
305 >  NPTxyz ( SimInfo *theInfo, ForceFields* the_ff);
306 >  virtual ~NPTxyz();
307  
328  void setTauThermostat(double tt) {tauThermostat = tt; have_tau_thermostat=1;}
329  void setTauBarostat(double tb) {tauBarostat = tb; have_tau_barostat=1;}
330  void setTargetTemp(double tt) {targetTemp = tt; have_target_temp = 1;}
331  void setTargetPressure(double tp) {targetPressure = tp; have_target_pressure = 1;}
332
333 protected:
334
335  virtual void moveA( void );
336  virtual void moveB( void );
337
338  virtual int readyCheck();
339
340  virtual void resetIntegrator( void );
341
342  Molecule* myMolecules;
343  Atom** myAtoms;
344
345  // chi and eta are the propagated degrees of freedom
346
347  double chi;
348  double eta;
349  double etaZ;
350  double NkBT;
351
352  // targetTemp, targetPressure, and tauBarostat must be set.  
353  // One of qmass or tauThermostat must be set;
354
355  double targetTemp;
356  double targetPressure;
357  double tauThermostat;
358  double tauBarostat;
359
360  short int have_tau_thermostat, have_tau_barostat, have_target_temp;
361  short int have_target_pressure;
362
363 };
364
365 template<typename T> class NPTf : public T{
366
367 public:
368
369  NPTf ( SimInfo *theInfo, ForceFields* the_ff);
370  virtual ~NPTf();
371
372  virtual void integrateStep( int calcPot, int calcStress ){
373    calcStress = 1;
374    T::integrateStep( calcPot, calcStress );
375  }
376  
308    virtual double getConservedQuantity(void);
309 +  virtual string getAdditionalParameters(void);
310 +  virtual void resetIntegrator(void);
311  
379  void setTauThermostat(double tt) {tauThermostat = tt; have_tau_thermostat=1;}
380  void setTauBarostat(double tb) {tauBarostat = tb; have_tau_barostat=1;}
381  void setTargetTemp(double tt) {targetTemp = tt; have_target_temp = 1;}
382  void setTargetPressure(double tp) {targetPressure = tp; have_target_pressure = 1;}
383  void setChiTolerance(double tol) {chiTolerance = tol;}
384  void setPosIterTolerance(double tol) {posIterTolerance = tol;}
385
312   protected:
313  
314 <  virtual void  moveA( void );
315 <  virtual void moveB( void );
314 >  virtual void evolveEtaA(void);
315 >  virtual void evolveEtaB(void);
316  
317 <  virtual void resetIntegrator( void );
317 >  virtual bool etaConverged( void );
318  
319 <  virtual int readyCheck();
319 >  virtual void scaleSimBox( void );
320  
321 <
322 <  // chi and eta are the propagated degrees of freedom
323 <
324 <  double chi;
399 <  double eta[3][3];
400 <  double NkBT;
401 <  double fkBT;
402 <
403 <  int Nparticles;
404 <
405 <  double *oldPos;
406 <  double *oldVel;
407 <  double *oldJi;
408 <
409 <  double integralOfChidt;
410 <  
411 <  // targetTemp, targetPressure, and tauBarostat must be set.  
412 <  // One of qmass or tauThermostat must be set;
413 <
414 <  double targetTemp;
415 <  double targetPressure;
416 <  double tauThermostat;
417 <  double tauBarostat;
418 <
419 <  short int have_tau_thermostat, have_tau_barostat, have_target_temp;
420 <  short int have_target_pressure;
421 <  double chiTolerance;
422 <  short int have_chi_tolerance;
423 <  double posIterTolerance;
424 <  short int have_pos_iter_tolerance;
425 <  double etaTolerance;
426 <  short int have_eta_tolerance;
427 < };
428 <
429 < template<typename T> class NPTxym : public T{
430 <
431 < public:
432 <
433 <  NPTxym ( SimInfo *theInfo, ForceFields* the_ff);
434 <  virtual ~NPTxym() {};
435 <
436 <  virtual void integrateStep( int calcPot, int calcStress ){
437 <    calcStress = 1;
438 <    T::integrateStep( calcPot, calcStress );
439 <  }
440 <
441 <  void setTauThermostat(double tt) {tauThermostat = tt; have_tau_thermostat=1;}
442 <  void setTauBarostat(double tb) {tauBarostat = tb; have_tau_barostat=1;}
443 <  void setTargetTemp(double tt) {targetTemp = tt; have_target_temp = 1;}
444 <  void setTargetPressure(double tp) {targetPressure = tp; have_target_pressure = 1;}
445 <
446 < protected:
447 <
448 <  virtual void moveA( void );
449 <  virtual void moveB( void );
450 <
451 <  virtual int readyCheck();
452 <
453 <  virtual void resetIntegrator( void );
454 <
455 <  Molecule* myMolecules;
456 <  Atom** myAtoms;
321 >  virtual void getVelScaleA( double sc[3], double vel[3] );
322 >  virtual void getVelScaleB( double sc[3], int index );
323 >  virtual void getPosScale(double pos[3], double COM[3],
324 >                           int index, double sc[3]);
325  
326 <  // chi and eta are the propagated degrees of freedom
326 >  virtual void calcVelScale( void );
327  
460  double chi;
461  double eta;
462  double etaX;
463  double etaY;
464  double NkBT;
465
466  // targetTemp, targetPressure, and tauBarostat must be set.  
467  // One of qmass or tauThermostat must be set;
468
469  double targetTemp;
470  double targetPressure;
471  double tauThermostat;
472  double tauBarostat;
473
474  short int have_tau_thermostat, have_tau_barostat, have_target_temp;
475  short int have_target_pressure;
476
477 };
478
479
480 template<typename T> class NPTfm : public T{
481
482 public:
483
484  NPTfm ( SimInfo *theInfo, ForceFields* the_ff);
485  virtual ~NPTfm() {};
486
487  virtual void integrateStep( int calcPot, int calcStress ){
488    calcStress = 1;
489    T::integrateStep( calcPot, calcStress );
490    accIntegralOfChidt();
491  }
492
493  virtual double getConservedQuantity(void);
494  
495  void setTauThermostat(double tt) {tauThermostat = tt; have_tau_thermostat=1;}
496  void setTauBarostat(double tb) {tauBarostat = tb; have_tau_barostat=1;}
497  void setTargetTemp(double tt) {targetTemp = tt; have_target_temp = 1;}
498  void setTargetPressure(double tp) {targetPressure = tp; have_target_pressure = 1;}
499  void setChiTolerance(double tol) {chiTolerance = tol;}
500  void setPosIterTolerance(double tol) {posIterTolerance = tol;}
501
502 protected:
503
504  virtual void  moveA( void );
505  virtual void moveB( void );
506
507  virtual void resetIntegrator( void );
508
509  virtual int readyCheck();
510
511  void accIntegralOfChidt(void) { integralOfChidt += dt * chi;}
512
513  Molecule* myMolecules;
514  Atom** myAtoms;
515
516  // chi and eta are the propagated degrees of freedom
517
518  double chi;
328    double eta[3][3];
329 <  double NkBT;
330 <  double integralOfChidt;
331 <
523 <  // targetTemp, targetPressure, and tauBarostat must be set.  
524 <  // One of qmass or tauThermostat must be set;
525 <
526 <  double targetTemp;
527 <  double targetPressure;
528 <  double tauThermostat;
529 <  double tauBarostat;
530 <
531 <  short int have_tau_thermostat, have_tau_barostat, have_target_temp;
532 <  short int have_target_pressure;
533 <  double chiTolerance;
534 <  short int have_chi_tolerance;
535 <  double posIterTolerance;
536 <  short int have_pos_iter_tolerance;
537 <
329 >  double oldEta[3][3];
330 >  double prevEta[3][3];
331 >  double vScale[3][3];
332   };
333  
334  
541 template<typename T> class NPTpr : public T{
542
543 public:
544
545  NPTpr ( SimInfo *theInfo, ForceFields* the_ff);
546  virtual ~NPTpr() {};
547
548  virtual void integrateStep( int calcPot, int calcStress ){
549    calcStress = 1;
550    T::integrateStep( calcPot, calcStress );
551  }
552
553  void setTauThermostat(double tt) {tauThermostat = tt; have_tau_thermostat=1;}
554  void setTauBarostat(double tb) {tauBarostat = tb; have_tau_barostat=1;}
555  void setTargetTemp(double tt) {targetTemp = tt; have_target_temp = 1;}
556  void setTargetPressure(double tp) {targetPressure = tp; have_target_pressure = 1;}
557  void setChiTolerance(double tol) {chiTolerance = tol;}
558  void setPosIterTolerance(double tol) {posIterTolerance = tol;}
559
560 protected:
561
562  virtual void  moveA( void );
563  virtual void moveB( void );
564
565  virtual int readyCheck();
566
567  virtual void resetIntegrator( void );
568
569  // chi and eta are the propagated degrees of freedom
570
571  double chi;
572  double eta[3][3];
573  double NkBT;
574
575  // targetTemp, targetPressure, and tauBarostat must be set.  
576  // One of qmass or tauThermostat must be set;
577
578  double targetTemp;
579  double targetPressure;
580  double tauThermostat;
581  double tauBarostat;
582
583  short int have_tau_thermostat, have_tau_barostat, have_target_temp;
584  short int have_target_pressure;
585  double chiTolerance;
586  short int have_chi_tolerance;
587  double posIterTolerance;
588  short int have_pos_iter_tolerance;
589
590 };
591
592
335   template<typename T> class ZConstraint : public T {
336 <  
337 <  public:
336 >
337 >  public:
338    class ForceSubtractionPolicy{
339      public:
340        ForceSubtractionPolicy(ZConstraint<T>* integrator) {zconsIntegrator = integrator;}
341  
342 <      virtual void update() = 0;    
342 >      virtual void update() = 0;
343        virtual double getZFOfFixedZMols(Molecule* mol, Atom* atom, double totalForce) = 0;
344        virtual double getZFOfMovingMols(Atom* atom, double totalForce) = 0;
345        virtual double getHFOfFixedZMols(Molecule* mol, Atom* atom, double totalForce) = 0;
346        virtual double getHFOfUnconsMols(Atom* atom, double totalForce) = 0;
347 <    
347 >
348     protected:
349 <     ZConstraint<T>* zconsIntegrator;;
349 >     ZConstraint<T>* zconsIntegrator;
350    };
351  
352    class PolicyByNumber : public ForceSubtractionPolicy{
353  
354      public:
355 <      PolicyByNumber(ZConstraint<T>* integrator) :ForceSubtractionPolicy(integrator) {}    
356 <      virtual void update();    
355 >      PolicyByNumber(ZConstraint<T>* integrator) :ForceSubtractionPolicy(integrator) {}
356 >      virtual void update();
357        virtual double getZFOfFixedZMols(Molecule* mol, Atom* atom, double totalForce) ;
358        virtual double getZFOfMovingMols(Atom* atom, double totalForce) ;
359        virtual double getHFOfFixedZMols(Molecule* mol, Atom* atom, double totalForce);
360        virtual double getHFOfUnconsMols(Atom* atom, double totalForce);
361 <    
361 >
362      private:
363        int totNumOfMovingAtoms;
364    };
# Line 624 | Line 366 | template<typename T> class ZConstraint : public T {
366    class PolicyByMass : public ForceSubtractionPolicy{
367  
368      public:
369 <      PolicyByMass(ZConstraint<T>* integrator) :ForceSubtractionPolicy(integrator) {}  
370 <      
371 <      virtual void update();    
369 >      PolicyByMass(ZConstraint<T>* integrator) :ForceSubtractionPolicy(integrator) {}
370 >
371 >      virtual void update();
372        virtual double getZFOfFixedZMols(Molecule* mol, Atom* atom, double totalForce) ;
373        virtual double getZFOfMovingMols(Atom* atom, double totalForce) ;
374        virtual double getHFOfFixedZMols(Molecule* mol, Atom* atom, double totalForce);
# Line 640 | Line 382 | template<typename T> class ZConstraint : public T {
382  
383    ZConstraint( SimInfo *theInfo, ForceFields* the_ff);
384    ~ZConstraint();
385 <    
385 >
386    void setZConsTime(double time)                  {this->zconsTime = time;}
387    void getZConsTime()                             {return zconsTime;}
388 <  
388 >
389    void setIndexOfAllZConsMols(vector<int> index) {indexOfAllZConsMols = index;}
390    void getIndexOfAllZConsMols()                  {return indexOfAllZConsMols;}
391 <  
391 >
392    void setZConsOutput(const char * fileName)          {zconsOutput = fileName;}
393    string getZConsOutput()                         {return zconsOutput;}
394 <  
394 >
395    virtual void integrate();
654  
396  
397 +
398   #ifdef IS_MPI
399    virtual void update();                      //which is called to indicate the molecules' migration
400   #endif
401  
402 +  enum ZConsState {zcsMoving, zcsFixed};
403 +
404 +  vector<Molecule*> zconsMols;              //z-constraint molecules array
405 +  vector<ZConsState> states;                 //state of z-constraint molecules
406 +
407 +
408 +
409 +  int totNumOfUnconsAtoms;              //total number of uncontraint atoms
410 +  double totalMassOfUncons;                //total mas of unconstraint molecules
411 +
412 +
413   protected:
414  
415 <  enum ZConsState {zcsMoving, zcsFixed};  
416 <
417 <  virtual void calcForce( int calcPot, int calcStress );
415 >
416 >
417 >  virtual void calcForce( int calcPot, int calcStress );
418    virtual void thermalize(void);
419 <  
419 >
420    void zeroOutVel();
421    void doZconstraintForce();
422 <  void doHarmonic();
422 >  void doHarmonic(vector<double>& resPos);
423    bool checkZConsState();
424  
425    bool haveFixedZMols();
# Line 681 | Line 434 | template<typename T> class ZConstraint : public T {
434    double zconsTol;                                 //tolerance of z-contratint
435    double zForceConst;                           //base force constant term
436                                                            //which is estimate by OOPSE
437 <  
438 <  vector<Molecule*> zconsMols;              //z-constraint molecules array
439 <  vector<double> massOfZConsMols;       //mass of z-constraint molecule
437 >
438 >
439 >  vector<double> massOfZConsMols;       //mass of z-constraint molecule
440    vector<double> kz;                              //force constant array
441 <  vector<ZConsState> states;                 //state of z-constraint molecules
441 >
442    vector<double> zPos;                          //
443 <  
444 <  
443 >
444 >
445    vector<Molecule*> unconsMols;           //unconstraint molecules array
446    vector<double> massOfUnconsMols;    //mass array of unconstraint molecules
694  double totalMassOfUncons;                //total mas of unconstraint molecules
447  
448 +
449    vector<ZConsParaItem>* parameters; //
450 <  
450 >
451    vector<int> indexOfAllZConsMols;     //index of All Z-Constraint Molecuels
452  
453 <  int* indexOfZConsMols;                   //index of local Z-Constraint Molecules  
454 <  double* fz;
455 <  double* curZPos;
703 <  
704 <  int totNumOfUnconsAtoms;              //total number of uncontraint atoms
453 >  vector<int> indexOfZConsMols;                   //index of local Z-Constraint Molecules
454 >  vector<double> fz;
455 >  vector<double> curZPos;
456  
457 <  int whichDirection;                           //constraint direction
457 >  bool usingSMD;
458 >  vector<double> cantPos;
459 >  vector<double> cantVel;
460 >
461 >  double zconsFixTime;  
462 >  double zconsGap;
463 >  bool hasZConsGap;
464 >  vector<double> endFixTime;
465    
466 +  int whichDirection;                           //constraint direction
467 +
468   private:
469 <  
469 >
470    string zconsOutput;                         //filename of zconstraint output
471    ZConsWriter* fzOut;                         //z-constraint writer
472  
473 <  double curZconsTime;                      
473 >  double curZconsTime;
474  
475    double calcMovingMolsCOMVel();
476    double calcSysCOMVel();
477    double calcTotalForce();
478 +  void updateZPos();
479 +  void updateCantPos();
480    
481    ForceSubtractionPolicy* forcePolicy; //force subtraction policy
482    friend class ForceSubtractionPolicy;
483  
484   };
485  
486 + /*
487 + //Steered Molecular Dynamics
488 + template<typename T> class SMD : public T{
489 +  public:
490 +    SMD( SimInfo *theInfo, ForceFields* the_ff);
491 +    ~SMD();
492 +  
493 +   virtual void integrate();
494 +  virtual void calcForce( int calcPot, int calcStress );  
495 + };
496 + */
497   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines