| 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" |
| 21 |
|
const int maxIteration = 300; |
| 22 |
|
const double tol = 1.0e-6; |
| 23 |
|
|
| 23 |
– |
|
| 24 |
|
template<typename T = BaseIntegrator> class Integrator : public T { |
| 25 |
|
|
| 26 |
|
public: |
| 45 |
|
virtual void calcForce( int calcPot, int calcStress ); |
| 46 |
|
virtual void thermalize(); |
| 47 |
|
|
| 48 |
< |
virtual void rotationPropagation( DirectionalAtom* dAtom, double ji[3] ); |
| 48 |
> |
virtual void rotationPropagation( StuntDouble* sd, double ji[3] ); |
| 49 |
|
|
| 50 |
|
void checkConstraints( void ); |
| 51 |
|
void rotate( int axes1, int axes2, double angle, double j[3], |
| 54 |
|
ForceFields* myFF; |
| 55 |
|
|
| 56 |
|
SimInfo *info; // all the info we'll ever need |
| 57 |
+ |
vector<StuntDouble*> integrableObjects; |
| 58 |
|
int nAtoms; /* the number of atoms */ |
| 59 |
|
int oldAtoms; |
| 60 |
|
Atom **atoms; /* array of atom pointers */ |
| 154 |
|
|
| 155 |
|
virtual double getConservedQuantity(void) = 0; |
| 156 |
|
virtual string getAdditionalParameters(void) = 0; |
| 157 |
+ |
|
| 158 |
+ |
double myTauThermo( void ) { return tauThermostat; } |
| 159 |
+ |
double myTauBaro( void ) { return tauBarostat; } |
| 160 |
+ |
|
| 161 |
|
void setTauThermostat(double tt) {tauThermostat = tt; have_tau_thermostat=1;} |
| 162 |
|
void setTauBarostat(double tb) {tauBarostat = tb; have_tau_barostat=1;} |
| 163 |
|
void setTargetTemp(double tt) {targetTemp = tt; have_target_temp = 1;} |
| 180 |
|
virtual void getPosScale(double pos[3], double COM[3], |
| 181 |
|
int index, double sc[3]) = 0; |
| 182 |
|
|
| 183 |
+ |
virtual void calcVelScale( void ) = 0; |
| 184 |
+ |
|
| 185 |
|
virtual bool chiConverged( void ); |
| 186 |
|
virtual bool etaConverged( void ) = 0; |
| 187 |
|
|
| 258 |
|
virtual void getVelScaleB( double sc[3], int index ); |
| 259 |
|
virtual void getPosScale(double pos[3], double COM[3], |
| 260 |
|
int index, double sc[3]); |
| 261 |
+ |
|
| 262 |
+ |
virtual void calcVelScale( void ); |
| 263 |
|
|
| 264 |
|
double eta, oldEta, prevEta; |
| 265 |
+ |
double vScale; |
| 266 |
|
}; |
| 267 |
|
|
| 268 |
|
template<typename T> class NPTf : public T{ |
| 290 |
|
virtual void getPosScale(double pos[3], double COM[3], |
| 291 |
|
int index, double sc[3]); |
| 292 |
|
|
| 293 |
+ |
virtual void calcVelScale( void ); |
| 294 |
+ |
|
| 295 |
|
double eta[3][3]; |
| 296 |
|
double oldEta[3][3]; |
| 297 |
|
double prevEta[3][3]; |
| 298 |
+ |
double vScale[3][3]; |
| 299 |
|
}; |
| 300 |
|
|
| 301 |
|
template<typename T> class NPTxyz : public T{ |
| 323 |
|
virtual void getPosScale(double pos[3], double COM[3], |
| 324 |
|
int index, double sc[3]); |
| 325 |
|
|
| 326 |
+ |
virtual void calcVelScale( void ); |
| 327 |
+ |
|
| 328 |
|
double eta[3][3]; |
| 329 |
|
double oldEta[3][3]; |
| 330 |
|
double prevEta[3][3]; |
| 331 |
+ |
double vScale[3][3]; |
| 332 |
|
}; |
| 333 |
|
|
| 334 |
|
|
| 419 |
|
|
| 420 |
|
void zeroOutVel(); |
| 421 |
|
void doZconstraintForce(); |
| 422 |
< |
void doHarmonic(); |
| 422 |
> |
void doHarmonic(vector<double>& resPos); |
| 423 |
|
bool checkZConsState(); |
| 424 |
|
|
| 425 |
|
bool haveFixedZMols(); |
| 449 |
|
vector<ZConsParaItem>* parameters; // |
| 450 |
|
|
| 451 |
|
vector<int> indexOfAllZConsMols; //index of All Z-Constraint Molecuels |
| 436 |
– |
|
| 437 |
– |
int* indexOfZConsMols; //index of local Z-Constraint Molecules |
| 438 |
– |
double* fz; |
| 439 |
– |
double* curZPos; |
| 452 |
|
|
| 453 |
+ |
vector<int> indexOfZConsMols; //index of local Z-Constraint Molecules |
| 454 |
+ |
vector<double> fz; |
| 455 |
+ |
vector<double> curZPos; |
| 456 |
|
|
| 457 |
+ |
bool usingSMD; |
| 458 |
+ |
vector<double> cantPos; |
| 459 |
+ |
vector<double> cantVel; |
| 460 |
|
|
| 461 |
+ |
double zconsFixTime; |
| 462 |
+ |
double zconsGap; |
| 463 |
+ |
bool hasZConsGap; |
| 464 |
+ |
vector<double> endFixTime; |
| 465 |
+ |
|
| 466 |
|
int whichDirection; //constraint direction |
| 467 |
|
|
| 468 |
|
private: |
| 475 |
|
double calcMovingMolsCOMVel(); |
| 476 |
|
double calcSysCOMVel(); |
| 477 |
|
double calcTotalForce(); |
| 478 |
< |
|
| 478 |
> |
void updateZPos(); |
| 479 |
> |
void updateCantPos(); |
| 480 |
> |
|
| 481 |
|
ForceSubtractionPolicy* forcePolicy; //force subtraction policy |
| 482 |
|
friend class ForceSubtractionPolicy; |
| 483 |
|
|
| 484 |
|
}; |
| 485 |
|
|
| 486 |
+ |
/* |
| 487 |
+ |
//Steered Molecular Dynamics |
| 488 |
+ |
template<typename T> class SMD : public T{ |
| 489 |
+ |
public: |
| 490 |
+ |
SMD( SimInfo *theInfo, ForceFields* the_ff); |
| 491 |
+ |
~SMD(); |
| 492 |
+ |
|
| 493 |
+ |
virtual void integrate(); |
| 494 |
+ |
virtual void calcForce( int calcPot, int calcStress ); |
| 495 |
+ |
}; |
| 496 |
+ |
*/ |
| 497 |
|
#endif |