| 12 |
|
class Integrator : public BaseIntegrator { |
| 13 |
|
|
| 14 |
|
public: |
| 15 |
< |
Symplectic( SimInfo &theInfo, ForceFields* the_ff ); |
| 16 |
< |
virtual ~Symplectic(); |
| 15 |
> |
Integrator( SimInfo &theInfo, ForceFields* the_ff ); |
| 16 |
> |
virtual ~Integrator(); |
| 17 |
|
void integrate( void ); |
| 18 |
|
|
| 19 |
|
|
| 21 |
|
|
| 22 |
|
|
| 23 |
|
virtual void integrateStep( int calcPot, int calcStress ); |
| 24 |
+ |
virtual void preMove( void ); |
| 25 |
|
virtual void moveA( void ); |
| 26 |
|
virtual void moveB( void ); |
| 27 |
|
virtual void constrainA( void ); |
| 28 |
|
virtual void constrainB( void ); |
| 29 |
+ |
virtual int readyCheck( void ) { return 1; } |
| 30 |
|
|
| 29 |
– |
|
| 31 |
|
void checkConstraints( void ); |
| 32 |
|
void rotate( int axes1, int axes2, double angle, double j[3], |
| 33 |
|
double A[3][3] ); |
| 37 |
|
|
| 38 |
|
SimInfo *info; // all the info we'll ever need |
| 39 |
|
int nAtoms; /* the number of atoms */ |
| 40 |
+ |
int oldAtoms; |
| 41 |
|
Atom **atoms; /* array of atom pointers */ |
| 42 |
|
Molecule* molecules; |
| 43 |
|
int nMols; |
| 44 |
|
|
| 45 |
< |
int isConstrained; /*boolean to know whether the systems contains |
| 46 |
< |
constraints. */ |
| 47 |
< |
int nConstrained; /*counter for number of constraints */ |
| 48 |
< |
int *constrainedI; /* the i of a constraint pair */ |
| 49 |
< |
int *constrainedJ; /* the j of a constraint pair */ |
| 50 |
< |
double *constrainedDsqr; /* the square of the constraint distance */ |
| 45 |
> |
int isConstrained; // boolean to know whether the systems contains |
| 46 |
> |
// constraints. |
| 47 |
> |
int nConstrained; // counter for number of constraints |
| 48 |
> |
int *constrainedA; // the i of a constraint pair |
| 49 |
> |
int *constrainedB; // the j of a constraint pair |
| 50 |
> |
double *constrainedDsqr; // the square of the constraint distance |
| 51 |
> |
|
| 52 |
> |
int* moving; // tells whether we are moving atom i |
| 53 |
> |
int* moved; // tells whether we have moved atom i |
| 54 |
> |
double* prePos; // pre constrained positions |
| 55 |
> |
|
| 56 |
|
short isFirst; /*boolean for the first time integrate is called */ |
| 57 |
|
|
| 58 |
|
double dt; |
| 59 |
|
double dt2; |
| 60 |
< |
const double eConvert; |
| 60 |
> |
const double eConvert = 4.184e-4; // converts kcal/mol -> amu*A^2/fs^2 |
| 61 |
|
|
| 62 |
+ |
const int maxIteration = 300; |
| 63 |
+ |
const double tol = 1.0e-6; |
| 64 |
+ |
|
| 65 |
|
|
| 66 |
|
double* pos; |
| 67 |
|
double* vel; |
| 77 |
|
|
| 78 |
|
}; |
| 79 |
|
|
| 80 |
+ |
class NVE : public Integrator{ |
| 81 |
|
|
| 82 |
+ |
NVE ( void ): |
| 83 |
+ |
Integrator( theInfo, the_ff ){} |
| 84 |
+ |
virtual ~NVE(){} |
| 85 |
+ |
|
| 86 |
+ |
|
| 87 |
+ |
|
| 88 |
+ |
}; |
| 89 |
+ |
|
| 90 |
|
class NVT : public Integrator{ |
| 91 |
|
|
| 92 |
< |
NVT ( void ); |
| 92 |
> |
NVT ( SimInfo &theInfo, ForceFields* the_ff ) : |
| 93 |
> |
Integrator( theInfo, the_ff ); |
| 94 |
|
virtual ~NVT(); |
| 95 |
|
|
| 96 |
|
protected: |