--- trunk/OOPSE/libmdtools/Integrator.hpp 2004/04/28 23:09:32 1141 +++ trunk/OOPSE/libmdtools/Integrator.hpp 2004/06/04 03:15:31 1234 @@ -13,6 +13,7 @@ #include "Thermo.hpp" #include "ReadWrite.hpp" #include "ZConsWriter.hpp" +#include "Restraints.hpp" using namespace std; const double kB = 8.31451e-7;// boltzmann constant amu*Ang^2*fs^-2/K @@ -21,6 +22,7 @@ template class Integrator const int maxIteration = 300; const double tol = 1.0e-6; +class RattleFramework; template class Integrator : public T { public: @@ -33,11 +35,11 @@ template class Integrator protected: virtual void integrateStep( int calcPot, int calcStress ); - virtual void preMove( void ); + //virtual void preMove( void ); virtual void moveA( void ); virtual void moveB( void ); - virtual void constrainA( void ); - virtual void constrainB( void ); + //virtual void constrainA( void ); + //virtual void constrainB( void ); virtual int readyCheck( void ) { return 1; } virtual void resetIntegrator( void ) { } @@ -49,7 +51,7 @@ template class Integrator virtual void rotationPropagation( StuntDouble* sd, double ji[3] ); - void checkConstraints( void ); + //void checkConstraints( void ); void rotate( int axes1, int axes2, double angle, double j[3], double A[3][3] ); @@ -63,16 +65,17 @@ template class Integrator Molecule* molecules; int nMols; - int isConstrained; // boolean to know whether the systems contains - // constraints. - int nConstrained; // counter for number of constraints - int *constrainedA; // the i of a constraint pair - int *constrainedB; // the j of a constraint pair - double *constrainedDsqr; // the square of the constraint distance + RattleFramework* rattle; - int* moving; // tells whether we are moving atom i - int* moved; // tells whether we have moved atom i - double* oldPos; // pre constrained positions + //int isConstrained; // boolean to know whether the systems contains constraints. + //int nConstrained; // counter for number of constraints + //int *constrainedA; // the i of a constraint pair + //int *constrainedB; // the j of a constraint pair + //double *constrainedDsqr; // the square of the constraint distance + + //int* moving; // tells whether we are moving atom i + //int* moved; // tells whether we have moved atom i + //double* oldPos; // pre constrained positions short isFirst; /*boolean for the first time integrate is called */ @@ -86,6 +89,9 @@ typedef Integrator RealIntegrator; }; typedef Integrator RealIntegrator; + +// ansi instantiation +template class Integrator; template class NVE : public T { @@ -486,61 +492,4 @@ template class ZConstraint : public T { (p }; -/* -template class SingleZConstrain : public T{ - - -}; -*/ - -template class NonEquMD : public T { - public: - - - -}; - - -// -template class SingleZConstraint : public T{ - public: - SingleZConstraint(SimInfo *theInfo, ForceFields* the_ff); - ~SingleZConstraint(); - - bool stopIntegrator(); - - protected: - -}; - -//Steered Molecular Dynamics, curret implement only support one steered molecule - template class SMD : public T{ - public: - SMD( SimInfo *theInfo, ForceFields* the_ff); - ~SMD(); - - virtual void integrate(); - virtual void calcForce( int calcPot, int calcStress ); - bool stopIntegrator(); - private: - -}; - -//By using state pattern, Coordinate Drive is responsible for switching back and forth between -//Driven Molecular Dynamics and ZConstraint Method. -template class CoordinateDriver : public T { - public: - typedef T ParentIntegrator; - - CoordinateDriver(SimInfo*, ForceFields*, BaseIntegrator*, BaseIntegrator*); - ~CoordinateDriver(); - - virtual void integrate(); - - private: - BaseIntegrator* zconsIntegrator; - BaseIntegrator* drivenIntegrator; - -}; - #endif