251 |
|
int index, double sc[3]); |
252 |
|
|
253 |
|
double eta, oldEta, prevEta; |
254 |
– |
}; |
255 |
– |
|
256 |
– |
template<typename T> class NPTzm : public T{ |
257 |
– |
|
258 |
– |
public: |
259 |
– |
|
260 |
– |
NPTzm ( SimInfo *theInfo, ForceFields* the_ff); |
261 |
– |
virtual ~NPTzm() {}; |
262 |
– |
|
263 |
– |
virtual void integrateStep( int calcPot, int calcStress ){ |
264 |
– |
calcStress = 1; |
265 |
– |
T::integrateStep( calcPot, calcStress ); |
266 |
– |
} |
267 |
– |
|
268 |
– |
void setTauThermostat(double tt) {tauThermostat = tt; have_tau_thermostat=1;} |
269 |
– |
void setTauBarostat(double tb) {tauBarostat = tb; have_tau_barostat=1;} |
270 |
– |
void setTargetTemp(double tt) {targetTemp = tt; have_target_temp = 1;} |
271 |
– |
void setTargetPressure(double tp) {targetPressure = tp; have_target_pressure = 1;} |
272 |
– |
|
273 |
– |
protected: |
274 |
– |
|
275 |
– |
virtual void moveA( void ); |
276 |
– |
virtual void moveB( void ); |
277 |
– |
|
278 |
– |
virtual int readyCheck(); |
279 |
– |
|
280 |
– |
virtual void resetIntegrator( void ); |
281 |
– |
|
282 |
– |
Molecule* myMolecules; |
283 |
– |
Atom** myAtoms; |
284 |
– |
|
285 |
– |
// chi and eta are the propagated degrees of freedom |
286 |
– |
|
287 |
– |
double chi; |
288 |
– |
double eta; |
289 |
– |
double etaZ; |
290 |
– |
double NkBT; |
291 |
– |
|
292 |
– |
// targetTemp, targetPressure, and tauBarostat must be set. |
293 |
– |
// One of qmass or tauThermostat must be set; |
294 |
– |
|
295 |
– |
double targetTemp; |
296 |
– |
double targetPressure; |
297 |
– |
double tauThermostat; |
298 |
– |
double tauBarostat; |
299 |
– |
|
300 |
– |
short int have_tau_thermostat, have_tau_barostat, have_target_temp; |
301 |
– |
short int have_target_pressure; |
302 |
– |
|
254 |
|
}; |
255 |
|
|
256 |
|
template<typename T> class NPTf : public T{ |
282 |
|
double prevEta[3][3]; |
283 |
|
}; |
284 |
|
|
285 |
< |
template<typename T> class NPTxym : public T{ |
285 |
> |
template<typename T> class NPTxyz : public T{ |
286 |
|
|
287 |
|
public: |
288 |
|
|
289 |
< |
NPTxym ( SimInfo *theInfo, ForceFields* the_ff); |
290 |
< |
virtual ~NPTxym() {}; |
289 |
> |
NPTxyz ( SimInfo *theInfo, ForceFields* the_ff); |
290 |
> |
virtual ~NPTxyz(); |
291 |
|
|
292 |
< |
virtual void integrateStep( int calcPot, int calcStress ){ |
293 |
< |
calcStress = 1; |
343 |
< |
T::integrateStep( calcPot, calcStress ); |
344 |
< |
} |
345 |
< |
|
346 |
< |
void setTauThermostat(double tt) {tauThermostat = tt; have_tau_thermostat=1;} |
347 |
< |
void setTauBarostat(double tb) {tauBarostat = tb; have_tau_barostat=1;} |
348 |
< |
void setTargetTemp(double tt) {targetTemp = tt; have_target_temp = 1;} |
349 |
< |
void setTargetPressure(double tp) {targetPressure = tp; have_target_pressure = 1;} |
292 |
> |
virtual double getConservedQuantity(void); |
293 |
> |
virtual void resetIntegrator(void); |
294 |
|
|
295 |
|
protected: |
296 |
|
|
297 |
< |
virtual void moveA( void ); |
298 |
< |
virtual void moveB( void ); |
297 |
> |
virtual void evolveEtaA(void); |
298 |
> |
virtual void evolveEtaB(void); |
299 |
|
|
300 |
< |
virtual int readyCheck(); |
300 |
> |
virtual bool etaConverged( void ); |
301 |
|
|
302 |
< |
virtual void resetIntegrator( void ); |
302 |
> |
virtual void scaleSimBox( void ); |
303 |
|
|
304 |
< |
Molecule* myMolecules; |
305 |
< |
Atom** myAtoms; |
304 |
> |
virtual void getVelScaleA( double sc[3], double vel[3] ); |
305 |
> |
virtual void getVelScaleB( double sc[3], int index ); |
306 |
> |
virtual void getPosScale(double pos[3], double COM[3], |
307 |
> |
int index, double sc[3]); |
308 |
|
|
309 |
< |
// chi and eta are the propagated degrees of freedom |
310 |
< |
|
311 |
< |
double chi; |
366 |
< |
double eta; |
367 |
< |
double etaX; |
368 |
< |
double etaY; |
369 |
< |
double NkBT; |
370 |
< |
|
371 |
< |
// targetTemp, targetPressure, and tauBarostat must be set. |
372 |
< |
// One of qmass or tauThermostat must be set; |
373 |
< |
|
374 |
< |
double targetTemp; |
375 |
< |
double targetPressure; |
376 |
< |
double tauThermostat; |
377 |
< |
double tauBarostat; |
378 |
< |
|
379 |
< |
short int have_tau_thermostat, have_tau_barostat, have_target_temp; |
380 |
< |
short int have_target_pressure; |
381 |
< |
|
382 |
< |
}; |
383 |
< |
|
384 |
< |
|
385 |
< |
template<typename T> class NPTfm : public T{ |
386 |
< |
|
387 |
< |
public: |
388 |
< |
|
389 |
< |
NPTfm ( SimInfo *theInfo, ForceFields* the_ff); |
390 |
< |
virtual ~NPTfm() {}; |
391 |
< |
|
392 |
< |
virtual void integrateStep( int calcPot, int calcStress ){ |
393 |
< |
calcStress = 1; |
394 |
< |
T::integrateStep( calcPot, calcStress ); |
395 |
< |
accIntegralOfChidt(); |
396 |
< |
} |
397 |
< |
|
398 |
< |
virtual double getConservedQuantity(void); |
399 |
< |
|
400 |
< |
void setTauThermostat(double tt) {tauThermostat = tt; have_tau_thermostat=1;} |
401 |
< |
void setTauBarostat(double tb) {tauBarostat = tb; have_tau_barostat=1;} |
402 |
< |
void setTargetTemp(double tt) {targetTemp = tt; have_target_temp = 1;} |
403 |
< |
void setTargetPressure(double tp) {targetPressure = tp; have_target_pressure = 1;} |
404 |
< |
void setChiTolerance(double tol) {chiTolerance = tol;} |
405 |
< |
void setPosIterTolerance(double tol) {posIterTolerance = tol;} |
406 |
< |
|
407 |
< |
protected: |
408 |
< |
|
409 |
< |
virtual void moveA( void ); |
410 |
< |
virtual void moveB( void ); |
411 |
< |
|
412 |
< |
virtual void resetIntegrator( void ); |
413 |
< |
|
414 |
< |
virtual int readyCheck(); |
415 |
< |
|
416 |
< |
void accIntegralOfChidt(void) { integralOfChidt += dt * chi;} |
417 |
< |
|
418 |
< |
Molecule* myMolecules; |
419 |
< |
Atom** myAtoms; |
420 |
< |
|
421 |
< |
// chi and eta are the propagated degrees of freedom |
422 |
< |
|
423 |
< |
double chi; |
424 |
< |
double eta[3][3]; |
425 |
< |
double NkBT; |
426 |
< |
double integralOfChidt; |
427 |
< |
|
428 |
< |
// targetTemp, targetPressure, and tauBarostat must be set. |
429 |
< |
// One of qmass or tauThermostat must be set; |
430 |
< |
|
431 |
< |
double targetTemp; |
432 |
< |
double targetPressure; |
433 |
< |
double tauThermostat; |
434 |
< |
double tauBarostat; |
435 |
< |
|
436 |
< |
short int have_tau_thermostat, have_tau_barostat, have_target_temp; |
437 |
< |
short int have_target_pressure; |
438 |
< |
double chiTolerance; |
439 |
< |
short int have_chi_tolerance; |
440 |
< |
double posIterTolerance; |
441 |
< |
short int have_pos_iter_tolerance; |
442 |
< |
|
309 |
> |
double eta[3][3]; |
310 |
> |
double oldEta[3][3]; |
311 |
> |
double prevEta[3][3]; |
312 |
|
}; |
313 |
|
|
314 |
|
|
446 |
– |
template<typename T> class NPTpr : public T{ |
447 |
– |
|
448 |
– |
public: |
449 |
– |
|
450 |
– |
NPTpr ( SimInfo *theInfo, ForceFields* the_ff); |
451 |
– |
virtual ~NPTpr() {}; |
452 |
– |
|
453 |
– |
virtual void integrateStep( int calcPot, int calcStress ){ |
454 |
– |
calcStress = 1; |
455 |
– |
T::integrateStep( calcPot, calcStress ); |
456 |
– |
} |
457 |
– |
|
458 |
– |
void setTauThermostat(double tt) {tauThermostat = tt; have_tau_thermostat=1;} |
459 |
– |
void setTauBarostat(double tb) {tauBarostat = tb; have_tau_barostat=1;} |
460 |
– |
void setTargetTemp(double tt) {targetTemp = tt; have_target_temp = 1;} |
461 |
– |
void setTargetPressure(double tp) {targetPressure = tp; have_target_pressure = 1;} |
462 |
– |
void setChiTolerance(double tol) {chiTolerance = tol;} |
463 |
– |
void setPosIterTolerance(double tol) {posIterTolerance = tol;} |
464 |
– |
|
465 |
– |
protected: |
466 |
– |
|
467 |
– |
virtual void moveA( void ); |
468 |
– |
virtual void moveB( void ); |
469 |
– |
|
470 |
– |
virtual int readyCheck(); |
471 |
– |
|
472 |
– |
virtual void resetIntegrator( void ); |
473 |
– |
|
474 |
– |
// chi and eta are the propagated degrees of freedom |
475 |
– |
|
476 |
– |
double chi; |
477 |
– |
double eta[3][3]; |
478 |
– |
double NkBT; |
479 |
– |
|
480 |
– |
// targetTemp, targetPressure, and tauBarostat must be set. |
481 |
– |
// One of qmass or tauThermostat must be set; |
482 |
– |
|
483 |
– |
double targetTemp; |
484 |
– |
double targetPressure; |
485 |
– |
double tauThermostat; |
486 |
– |
double tauBarostat; |
487 |
– |
|
488 |
– |
short int have_tau_thermostat, have_tau_barostat, have_target_temp; |
489 |
– |
short int have_target_pressure; |
490 |
– |
double chiTolerance; |
491 |
– |
short int have_chi_tolerance; |
492 |
– |
double posIterTolerance; |
493 |
– |
short int have_pos_iter_tolerance; |
494 |
– |
|
495 |
– |
}; |
496 |
– |
|
497 |
– |
|
315 |
|
template<typename T> class ZConstraint : public T { |
316 |
|
|
317 |
|
public: |
326 |
|
virtual double getHFOfUnconsMols(Atom* atom, double totalForce) = 0; |
327 |
|
|
328 |
|
protected: |
329 |
< |
ZConstraint<T>* zconsIntegrator;; |
329 |
> |
ZConstraint<T>* zconsIntegrator; |
330 |
|
}; |
331 |
|
|
332 |
|
class PolicyByNumber : public ForceSubtractionPolicy{ |
379 |
|
virtual void update(); //which is called to indicate the molecules' migration |
380 |
|
#endif |
381 |
|
|
382 |
+ |
enum ZConsState {zcsMoving, zcsFixed}; |
383 |
+ |
|
384 |
+ |
vector<Molecule*> zconsMols; //z-constraint molecules array |
385 |
+ |
vector<ZConsState> states; //state of z-constraint molecules |
386 |
+ |
|
387 |
+ |
|
388 |
+ |
|
389 |
+ |
int totNumOfUnconsAtoms; //total number of uncontraint atoms |
390 |
+ |
double totalMassOfUncons; //total mas of unconstraint molecules |
391 |
+ |
|
392 |
+ |
|
393 |
|
protected: |
394 |
|
|
395 |
< |
enum ZConsState {zcsMoving, zcsFixed}; |
395 |
> |
|
396 |
|
|
397 |
|
virtual void calcForce( int calcPot, int calcStress ); |
398 |
|
virtual void thermalize(void); |
415 |
|
double zForceConst; //base force constant term |
416 |
|
//which is estimate by OOPSE |
417 |
|
|
418 |
< |
vector<Molecule*> zconsMols; //z-constraint molecules array |
418 |
> |
|
419 |
|
vector<double> massOfZConsMols; //mass of z-constraint molecule |
420 |
|
vector<double> kz; //force constant array |
421 |
< |
vector<ZConsState> states; //state of z-constraint molecules |
421 |
> |
|
422 |
|
vector<double> zPos; // |
423 |
|
|
424 |
|
|
425 |
|
vector<Molecule*> unconsMols; //unconstraint molecules array |
426 |
|
vector<double> massOfUnconsMols; //mass array of unconstraint molecules |
599 |
– |
double totalMassOfUncons; //total mas of unconstraint molecules |
427 |
|
|
428 |
+ |
|
429 |
|
vector<ZConsParaItem>* parameters; // |
430 |
|
|
431 |
|
vector<int> indexOfAllZConsMols; //index of All Z-Constraint Molecuels |
434 |
|
double* fz; |
435 |
|
double* curZPos; |
436 |
|
|
609 |
– |
int totNumOfUnconsAtoms; //total number of uncontraint atoms |
437 |
|
|
438 |
+ |
|
439 |
|
int whichDirection; //constraint direction |
440 |
|
|
441 |
|
private: |