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 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],
# 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 418 | 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 449 | 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 467 | 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 < class OOPSEMinimizerBase : public RealIntegrator {
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 <    OOPSEMinimizerBase ( SimInfo *theInfo, ForceFields* the_ff );
506 <    virtual ~OOPSEMinimizerBase();
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 <    double calcGradient(vector<double>& x, vector<double>& grad);
516 <    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();
515 >    bool stopIntegrator();
516 >    
517    protected:
518      
493    int dim;
494    void calcDim();
519   };
520  
521 < //template<typename TMinimizer> class OOPSEMinimizer : public OOPSEMinimizerBase, TMinimizer{
522 < //  public:
523 < //    void writeOutput();
524 < //};
525 < */  
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