--- trunk/OOPSE/libmdtools/Integrator.hpp 2003/07/31 15:35:07 658 +++ trunk/OOPSE/libmdtools/Integrator.hpp 2003/08/11 19:41:36 677 @@ -38,12 +38,14 @@ template class Integrator virtual void constrainA( void ); virtual void constrainB( void ); virtual int readyCheck( void ) { return 1; } + + virtual void calcForce( int calcPot, int calcStress ); + virtual void thermalize(); void checkConstraints( void ); void rotate( int axes1, int axes2, double angle, double j[3], double A[3][3] ); - - + ForceFields* myFF; SimInfo *info; // all the info we'll ever need @@ -302,10 +304,7 @@ template class ZConstraint : public T { (p ZConstraint( SimInfo *theInfo, ForceFields* the_ff); ~ZConstraint(); - - virtual void integrateStep( int calcPot, int calcStress ); - - + void setZConsTime(double time) {this->zconsTime = time;} void getZConsTime() {return zconsTime;} @@ -314,6 +313,9 @@ template class ZConstraint : public T { (p void setZConsOutput(const char * fileName) {zconsOutput = fileName;} string getZConsOutput() {return zconsOutput;} + + virtual void integrate(); + #ifdef IS_MPI virtual void update(); //which is called to indicate the molecules' migration @@ -321,30 +323,55 @@ template class ZConstraint : public T { (p protected: - double zconsTime; + enum ZConsState {zcsMoving, zcsFixed}; + + + + virtual void calcForce( int calcPot, int calcStress ); + virtual void thermalize(void); - void resetZ(void); + void zeroOutVel(); + void doZconstraintForce(); + bool checkZConsState(); + + bool haveFixedZMols(); + bool haveMovingZMols(); + + double calcZSys(); + + int isZConstraintMol(Molecule* mol); + + + double zconsTime; + double ztol; vector zconsMols; vector massOfZConsMols; + vector zconsPos; + vector kz; + vector states; + vector ZPos; + vector unconsMols; vector massOfUnconsMols; double totalMassOfUncons; - - vector allRefZ; - vector refZ; vector indexOfAllZConsMols; //index of All Z-Constraint Molecuels - int* indexOfZConsMols; //index of local Z-Constraint Molecules - + + int* indexOfZConsMols; //index of local Z-Constraint Molecules double* fz; -private: + int totNumOfUnconsAtoms; - int isZConstraintMol(Molecule* mol); + int whichDirection; //constraint direction + +private: + string zconsOutput; ZConsWriter* fzOut; + + }; #endif