--- trunk/OOPSE/libmdtools/Integrator.hpp 2003/03/27 20:12:15 423 +++ trunk/OOPSE/libmdtools/Integrator.hpp 2003/05/30 21:31:48 542 @@ -6,72 +6,80 @@ #include "AbstractClasses.hpp" #include "SimInfo.hpp" #include "ForceFields.hpp" +#include "Thermo.hpp" +#include "ReadWrite.hpp" -class Verlet : public Integrator { +class Integrator : public BaseIntegrator { public: - Verlet( SimInfo &info, ForceFields* the_ff ); - ~Verlet(); + Symplectic( SimInfo &theInfo, ForceFields* the_ff ); + virtual ~Symplectic(); void integrate( void ); -private: + +protected: + - void move_a( double dt ); - void move_b( double dt ); + virtual void integrateStep( int calcPot, int calcStress ); + virtual void moveA( void ); + virtual void moveB( void ); + virtual void constrainA( void ); + virtual void constrainB( void ); + + + void checkConstraints( void ); + void rotate( int axes1, int axes2, double angle, double j[3], + double A[3][3] ); + ForceFields* myFF; - SimInfo *entry_plug; // all the info we'll ever need - int c_natoms; /* the number of atoms */ - Atom **c_atoms; /* array of atom pointers */ + SimInfo *info; // all the info we'll ever need + int nAtoms; /* the number of atoms */ + Atom **atoms; /* array of atom pointers */ Molecule* molecules; int nMols; - int c_is_constrained; /*boolean to know whether the systems contains - constraints. */ - int c_n_constrained; /*counter for number of constraints */ - int *c_constrained_i; /* the i of a constraint pair */ - int *c_constrained_j; /* the j of a constraint pair */ - double *c_constrained_dsqr; /* the square of the constraint distance */ - double *c_mass; /* the array of masses */ - short is_first; /*boolean for the first time integrate is called */ - double c_box_x; - double c_box_y; - double c_box_z; -}; + int isConstrained; /*boolean to know whether the systems contains + constraints. */ + int nConstrained; /*counter for number of constraints */ + int *constrainedI; /* the i of a constraint pair */ + int *constrainedJ; /* the j of a constraint pair */ + double *constrainedDsqr; /* the square of the constraint distance */ + short isFirst; /*boolean for the first time integrate is called */ + + double dt; + double dt2; + const double eConvert = 4.184e-4; // converts kcal/mol -> amu*A^2/fs^2 -class Symplectic : public Integrator { -public: - Symplectic( SimInfo* the_entry_plug, ForceFields* the_ff ); - ~Symplectic(); + double* pos; + double* vel; + double* frc; + double* trq; + double* Amat; - void integrate( void ); -private: - void rotate( int axes1, int axes2, double angle, double j[3], - double A[3][3] ); + Thermo *tStats; + StatWriter* statOut; + DumpWriter* dumpOut; + +}; - SimInfo* entry_plug; - ForceFields* myFF; - Molecule* molecules; - int nMols; +class NVT : public Integrator{ - int is_constrained; /*boolean to know whether the systems contains - constraints. */ - int n_constrained; /*counter for number of constraints */ - int *constrained_i; /* the i of a constraint pair */ - int *constrained_j; /* the j of a constraint pair */ - double *constrained_dsqr; /* the square of the constraint distance */ - double *mass; /* the array of masses */ + NVT ( void ); + virtual ~NVT(); - short int isFirst; +protected: + virtual moveA( void ); + virtual moveB( void ); - SRI **srInteractions; /* array of SRI pointers */ - int nSRI; /* the number of short range interactions */ - }; + + + #endif