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 843 by mmeineke, Wed Oct 29 20:41:39 2003 UTC vs.
Revision 1180 by chrisfen, Thu May 20 20:24:07 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 12 | Line 13
13   #include "Thermo.hpp"
14   #include "ReadWrite.hpp"
15   #include "ZConsWriter.hpp"
16 + #include "Restraints.hpp"
17  
18   using namespace std;
19   const double kB = 8.31451e-7;// boltzmann constant amu*Ang^2*fs^-2/K
# Line 20 | Line 22 | const double tol = 1.0e-6;
22   const int maxIteration = 300;
23   const double tol = 1.0e-6;
24  
23
25   template<typename T = BaseIntegrator> class Integrator : public T {
26  
27   public:
# Line 45 | Line 46 | template<typename T = BaseIntegrator> class Integrator
46    virtual void calcForce( int calcPot, int calcStress );
47    virtual void thermalize();
48  
49 <  virtual void rotationPropagation( DirectionalAtom* dAtom, double ji[3] );
49 >  virtual bool stopIntegrator() {return false;}
50  
51 +  virtual void rotationPropagation( StuntDouble* sd, double ji[3] );
52 +
53    void checkConstraints( void );
54    void rotate( int axes1, int axes2, double angle, double j[3],
55           double A[3][3] );
# Line 54 | Line 57 | template<typename T = BaseIntegrator> class Integrator
57    ForceFields* myFF;
58  
59    SimInfo *info; // all the info we'll ever need
60 +  vector<StuntDouble*> integrableObjects;
61    int nAtoms;  /* the number of atoms */
62    int oldAtoms;
63    Atom **atoms; /* array of atom pointers */
# Line 80 | Line 84 | template<typename T = BaseIntegrator> class Integrator
84    StatWriter*  statOut;
85    DumpWriter*  dumpOut;
86  
87 +  int i; // just an int
88   };
89  
90   typedef Integrator<BaseIntegrator> RealIntegrator;
91  
92 + // ansi instantiation
93 + template class Integrator<BaseIntegrator>;
94 +
95   template<typename T> class NVE : public T {
96  
97   public:
# Line 179 | Line 187 | template<typename T> class NPT : public T{ (protected)
187    virtual void getPosScale(double pos[3], double COM[3],
188                             int index, double sc[3]) = 0;
189  
190 +  virtual void calcVelScale( void ) = 0;
191 +
192    virtual bool chiConverged( void );
193    virtual bool etaConverged( void ) = 0;
194  
# Line 256 | Line 266 | template<typename T> class NPTi : public T{ (protected
266    virtual void getPosScale(double pos[3], double COM[3],
267                             int index, double sc[3]);
268  
269 +  virtual void calcVelScale( void );
270 +
271    double eta, oldEta, prevEta;
272 +  double vScale;
273   };
274  
275   template<typename T> class NPTf : public T{
# Line 284 | Line 297 | template<typename T> class NPTf : public T{ (protected
297    virtual void getPosScale(double pos[3], double COM[3],
298                             int index, double sc[3]);
299  
300 +  virtual void calcVelScale( void );
301 +
302    double eta[3][3];
303    double oldEta[3][3];
304    double prevEta[3][3];
305 +  double vScale[3][3];
306   };
307  
308   template<typename T> class NPTxyz : public T{
# Line 314 | Line 330 | template<typename T> class NPTxyz : public T{ (protect
330    virtual void getPosScale(double pos[3], double COM[3],
331                             int index, double sc[3]);
332  
333 +  virtual void calcVelScale( void );
334 +
335    double eta[3][3];
336    double oldEta[3][3];
337    double prevEta[3][3];
338 +  double vScale[3][3];
339   };
340  
341  
# Line 407 | Line 426 | template<typename T> class ZConstraint : public T { (p
426  
427    void zeroOutVel();
428    void doZconstraintForce();
429 <  void doHarmonic();
429 >  void doHarmonic(vector<double>& resPos);
430    bool checkZConsState();
431  
432    bool haveFixedZMols();
# Line 438 | Line 457 | template<typename T> class ZConstraint : public T { (p
457  
458    vector<int> indexOfAllZConsMols;     //index of All Z-Constraint Molecuels
459  
460 <  int* indexOfZConsMols;                   //index of local Z-Constraint Molecules
461 <  double* fz;
462 <  double* curZPos;
460 >  vector<int> indexOfZConsMols;                   //index of local Z-Constraint Molecules
461 >  vector<double> fz;
462 >  vector<double> curZPos;
463  
464 +  bool usingSMD;
465 +  vector<double> prevCantPos;
466 +  vector<double> cantPos;
467 +  vector<double> cantVel;
468  
469 <
469 >  double zconsFixTime;  
470 >  double zconsGap;
471 >  bool hasZConsGap;
472 >  vector<double> endFixTime;
473 >  
474    int whichDirection;                           //constraint direction
475  
476   private:
# Line 456 | Line 483 | template<typename T> class ZConstraint : public T { (p
483    double calcMovingMolsCOMVel();
484    double calcSysCOMVel();
485    double calcTotalForce();
486 <
486 >  void updateZPos();
487 >  void updateCantPos();
488 >  
489    ForceSubtractionPolicy* forcePolicy; //force subtraction policy
490    friend class ForceSubtractionPolicy;
491 +
492 + };
493 +
494 + /*
495 + template<typename T> class SingleZConstrain : public T{
496 +
497 +
498 + };
499 + */
500  
501 + template<typename T> class NonEquMD : public T {
502 +  public:
503 +    
504 +
505 +
506   };
507  
508 +
509 + //
510 + template<typename T> class SingleZConstraint : public T{
511 +  public:
512 +    SingleZConstraint(SimInfo *theInfo, ForceFields* the_ff);
513 +    ~SingleZConstraint();
514 +    
515 +    bool stopIntegrator();
516 +    
517 +  protected:
518 +    
519 + };
520 +
521 + //Steered Molecular Dynamics, curret implement only support one steered molecule
522 + template<typename T> class SMD : public T{
523 +  public:
524 +    SMD( SimInfo *theInfo, ForceFields* the_ff);
525 +    ~SMD();
526 +  
527 +    virtual void integrate();
528 +    virtual void calcForce( int calcPot, int calcStress );  
529 +    bool stopIntegrator();
530 +  private:
531 +    
532 + };
533 +
534 + //By using state pattern, Coordinate Drive is responsible for switching back and forth between
535 + //Driven Molecular Dynamics and ZConstraint Method.
536 + template<typename T> class CoordinateDriver : public T {
537 +  public:
538 +    typedef T ParentIntegrator;
539 +
540 +    CoordinateDriver(SimInfo*, ForceFields*, BaseIntegrator*, BaseIntegrator*);
541 +    ~CoordinateDriver();
542 +    
543 +    virtual void integrate();
544 +
545 +  private:    
546 +    BaseIntegrator* zconsIntegrator;
547 +    BaseIntegrator* drivenIntegrator;
548 +    
549 + };
550 +
551   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines