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 1064 by tim, Tue Feb 24 15:44:45 2004 UTC vs.
Revision 1187 by chrisfen, Sat May 22 18:16:18 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 84 | Line 88 | template<typename T> class NVE : public T {
88  
89   typedef Integrator<BaseIntegrator> RealIntegrator;
90  
91 + // ansi instantiation
92 + template class Integrator<BaseIntegrator>;
93 +
94   template<typename T> class NVE : public T {
95  
96   public:
# Line 418 | Line 425 | template<typename T> class ZConstraint : public T { (p
425  
426    void zeroOutVel();
427    void doZconstraintForce();
428 <  void doHarmonic();
428 >  void doHarmonic(vector<double>& resPos);
429    bool checkZConsState();
430  
431    bool haveFixedZMols();
# Line 449 | Line 456 | template<typename T> class ZConstraint : public T { (p
456  
457    vector<int> indexOfAllZConsMols;     //index of All Z-Constraint Molecuels
458  
459 <  int* indexOfZConsMols;                   //index of local Z-Constraint Molecules
460 <  double* fz;
461 <  double* curZPos;
459 >  vector<int> indexOfZConsMols;                   //index of local Z-Constraint Molecules
460 >  vector<double> fz;
461 >  vector<double> curZPos;
462  
463 +  bool usingSMD;
464 +  vector<double> prevCantPos;
465 +  vector<double> cantPos;
466 +  vector<double> cantVel;
467  
468 <
468 >  double zconsFixTime;  
469 >  double zconsGap;
470 >  bool hasZConsGap;
471 >  vector<double> endFixTime;
472 >  
473    int whichDirection;                           //constraint direction
474  
475   private:
# Line 467 | Line 482 | template<typename T> class ZConstraint : public T { (p
482    double calcMovingMolsCOMVel();
483    double calcSysCOMVel();
484    double calcTotalForce();
485 <
485 >  void updateZPos();
486 >  void updateCantPos();
487 >  
488    ForceSubtractionPolicy* forcePolicy; //force subtraction policy
489    friend class ForceSubtractionPolicy;
490  
491   };
492  
493   /*
494 < class OOPSEMinimizerBase : public RealIntegrator {
494 > template<typename T> class SingleZConstrain : public T{
495 >
496 >
497 > };
498 > */
499 >
500 > template<typename T> class NonEquMD : public T {
501    public:
502 +    
503  
504 <    OOPSEMinimizerBase ( SimInfo *theInfo, ForceFields* the_ff );
505 <    virtual ~OOPSEMinimizerBase();
504 >
505 > };
506 >
507 >
508 > //
509 > template<typename T> class SingleZConstraint : public T{
510 >  public:
511 >    SingleZConstraint(SimInfo *theInfo, ForceFields* the_ff);
512 >    ~SingleZConstraint();
513      
514 <    double calcGradient(vector<double>& x, vector<double>& grad);
515 <    void setCoor(vector<double>& x);
485 <    vector<double> getCoor();
486 <    void output(vector<double>& x, int iteration);
487 <    int getDim() {return dim;}
488 <    void constraintMove();
489 <    void shakeF();
490 <    void shakeR();
514 >    bool stopIntegrator();
515 >    
516    protected:
517      
493    int dim;
494    void calcDim();
518   };
519  
520 < //template<typename TMinimizer> class OOPSEMinimizer : public OOPSEMinimizerBase, TMinimizer{
521 < //  public:
522 < //    void writeOutput();
523 < //};
524 < */  
520 > //Steered Molecular Dynamics, curret implement only support one steered molecule
521 > template<typename T> class SMD : public T{
522 >  public:
523 >    SMD( SimInfo *theInfo, ForceFields* the_ff);
524 >    ~SMD();
525 >  
526 >    virtual void integrate();
527 >    virtual void calcForce( int calcPot, int calcStress );  
528 >    bool stopIntegrator();
529 >  private:
530 >    
531 > };
532 >
533 > //By using state pattern, Coordinate Drive is responsible for switching back and forth between
534 > //Driven Molecular Dynamics and ZConstraint Method.
535 > template<typename T> class CoordinateDriver : public T {
536 >  public:
537 >    typedef T ParentIntegrator;
538 >
539 >    CoordinateDriver(SimInfo*, ForceFields*, BaseIntegrator*, BaseIntegrator*);
540 >    ~CoordinateDriver();
541 >    
542 >    virtual void integrate();
543 >
544 >  private:    
545 >    BaseIntegrator* zconsIntegrator;
546 >    BaseIntegrator* drivenIntegrator;
547 >    
548 > };
549 >
550   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines