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" |
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 |
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: |
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], |
55 |
|
double A[3][3] ); |
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 */ |
88 |
|
|
89 |
|
typedef Integrator<BaseIntegrator> RealIntegrator; |
90 |
|
|
91 |
+ |
// ansi instantiation |
92 |
+ |
template class Integrator<BaseIntegrator>; |
93 |
+ |
|
94 |
|
template<typename T> class NVE : public T { |
95 |
|
|
96 |
|
public: |
160 |
|
|
161 |
|
virtual double getConservedQuantity(void) = 0; |
162 |
|
virtual string getAdditionalParameters(void) = 0; |
163 |
+ |
|
164 |
+ |
double myTauThermo( void ) { return tauThermostat; } |
165 |
+ |
double myTauBaro( void ) { return tauBarostat; } |
166 |
+ |
|
167 |
|
void setTauThermostat(double tt) {tauThermostat = tt; have_tau_thermostat=1;} |
168 |
|
void setTauBarostat(double tb) {tauBarostat = tb; have_tau_barostat=1;} |
169 |
|
void setTargetTemp(double tt) {targetTemp = tt; have_target_temp = 1;} |
186 |
|
virtual void getPosScale(double pos[3], double COM[3], |
187 |
|
int index, double sc[3]) = 0; |
188 |
|
|
189 |
+ |
virtual void calcVelScale( void ) = 0; |
190 |
+ |
|
191 |
|
virtual bool chiConverged( void ); |
192 |
|
virtual bool etaConverged( void ) = 0; |
193 |
|
|
265 |
|
virtual void getPosScale(double pos[3], double COM[3], |
266 |
|
int index, double sc[3]); |
267 |
|
|
268 |
+ |
virtual void calcVelScale( void ); |
269 |
+ |
|
270 |
|
double eta, oldEta, prevEta; |
271 |
+ |
double vScale; |
272 |
|
}; |
273 |
|
|
274 |
|
template<typename T> class NPTf : public T{ |
296 |
|
virtual void getPosScale(double pos[3], double COM[3], |
297 |
|
int index, double sc[3]); |
298 |
|
|
299 |
+ |
virtual void calcVelScale( void ); |
300 |
+ |
|
301 |
|
double eta[3][3]; |
302 |
|
double oldEta[3][3]; |
303 |
|
double prevEta[3][3]; |
304 |
+ |
double vScale[3][3]; |
305 |
|
}; |
306 |
|
|
307 |
|
template<typename T> class NPTxyz : public T{ |
329 |
|
virtual void getPosScale(double pos[3], double COM[3], |
330 |
|
int index, double sc[3]); |
331 |
|
|
332 |
+ |
virtual void calcVelScale( void ); |
333 |
+ |
|
334 |
|
double eta[3][3]; |
335 |
|
double oldEta[3][3]; |
336 |
|
double prevEta[3][3]; |
337 |
+ |
double vScale[3][3]; |
338 |
|
}; |
339 |
|
|
340 |
|
|
425 |
|
|
426 |
|
void zeroOutVel(); |
427 |
|
void doZconstraintForce(); |
428 |
< |
void doHarmonic(); |
428 |
> |
void doHarmonic(vector<double>& resPos); |
429 |
|
bool checkZConsState(); |
430 |
|
|
431 |
|
bool haveFixedZMols(); |
456 |
|
|
457 |
|
vector<int> indexOfAllZConsMols; //index of All Z-Constraint Molecuels |
458 |
|
|
459 |
< |
int* indexOfZConsMols; //index of local Z-Constraint Molecules |
460 |
< |
double* fz; |
461 |
< |
double* curZPos; |
459 |
> |
vector<int> indexOfZConsMols; //index of local Z-Constraint Molecules |
460 |
> |
vector<double> fz; |
461 |
> |
vector<double> curZPos; |
462 |
|
|
463 |
+ |
bool usingSMD; |
464 |
+ |
vector<double> prevCantPos; |
465 |
+ |
vector<double> cantPos; |
466 |
+ |
vector<double> cantVel; |
467 |
|
|
468 |
< |
|
468 |
> |
double zconsFixTime; |
469 |
> |
double zconsGap; |
470 |
> |
bool hasZConsGap; |
471 |
> |
vector<double> endFixTime; |
472 |
> |
|
473 |
|
int whichDirection; //constraint direction |
474 |
|
|
475 |
|
private: |
482 |
|
double calcMovingMolsCOMVel(); |
483 |
|
double calcSysCOMVel(); |
484 |
|
double calcTotalForce(); |
485 |
< |
|
485 |
> |
void updateZPos(); |
486 |
> |
void updateCantPos(); |
487 |
> |
|
488 |
|
ForceSubtractionPolicy* forcePolicy; //force subtraction policy |
489 |
|
friend class ForceSubtractionPolicy; |
490 |
|
|