| 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 */ |
| 419 |
|
|
| 420 |
|
void zeroOutVel(); |
| 421 |
|
void doZconstraintForce(); |
| 422 |
< |
void doHarmonic(); |
| 422 |
> |
void doHarmonic(vector<double>& resPos); |
| 423 |
|
bool checkZConsState(); |
| 424 |
|
|
| 425 |
|
bool haveFixedZMols(); |
| 450 |
|
|
| 451 |
|
vector<int> indexOfAllZConsMols; //index of All Z-Constraint Molecuels |
| 452 |
|
|
| 453 |
< |
int* indexOfZConsMols; //index of local Z-Constraint Molecules |
| 454 |
< |
double* fz; |
| 455 |
< |
double* curZPos; |
| 455 |
< |
|
| 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 |
< |
class OOPSEMinimizerBase : public RealIntegrator { |
| 486 |
> |
/* |
| 487 |
> |
//Steered Molecular Dynamics |
| 488 |
> |
template<typename T> class SMD : public T{ |
| 489 |
|
public: |
| 490 |
< |
|
| 491 |
< |
OOPSEMinimizerBase ( SimInfo *theInfo, ForceFields* the_ff ); |
| 480 |
< |
virtual ~OOPSEMinimizerBase(); |
| 481 |
< |
|
| 482 |
< |
double calcGradient(const vector<double>& x, vector<double>& grad); |
| 483 |
< |
void setOptCoor(vector<double>& x); |
| 484 |
< |
void getOptCoor(vector<double>& x); |
| 485 |
< |
void output(); |
| 486 |
< |
|
| 487 |
< |
}; |
| 488 |
< |
|
| 489 |
< |
template<typename TMinimizer> class OOPSEMinimizer : public OOPSEMinimizerBase, TMinimizer{ |
| 490 |
< |
public: |
| 491 |
< |
void writeOutput(); |
| 492 |
< |
}; |
| 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 |