253 |
|
double eta, oldEta, prevEta; |
254 |
|
}; |
255 |
|
|
256 |
< |
template<typename T> class NPTzm : public T{ |
256 |
> |
template<typename T> class NPTf : 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 |
< |
} |
260 |
> |
NPTf ( SimInfo *theInfo, ForceFields* the_ff); |
261 |
> |
virtual ~NPTf(); |
262 |
|
|
263 |
< |
void setTauThermostat(double tt) {tauThermostat = tt; have_tau_thermostat=1;} |
264 |
< |
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;} |
263 |
> |
virtual double getConservedQuantity(void); |
264 |
> |
virtual void resetIntegrator(void); |
265 |
|
|
266 |
|
protected: |
267 |
|
|
268 |
< |
virtual void moveA( void ); |
269 |
< |
virtual void moveB( void ); |
268 |
> |
virtual void evolveEtaA(void); |
269 |
> |
virtual void evolveEtaB(void); |
270 |
|
|
271 |
< |
virtual int readyCheck(); |
271 |
> |
virtual bool etaConverged( void ); |
272 |
|
|
273 |
< |
virtual void resetIntegrator( void ); |
273 |
> |
virtual void scaleSimBox( void ); |
274 |
|
|
275 |
< |
Molecule* myMolecules; |
276 |
< |
Atom** myAtoms; |
275 |
> |
virtual void getVelScaleA( double sc[3], double vel[3] ); |
276 |
> |
virtual void getVelScaleB( double sc[3], int index ); |
277 |
> |
virtual void getPosScale(double pos[3], double COM[3], |
278 |
> |
int index, double sc[3]); |
279 |
|
|
280 |
< |
// chi and eta are the propagated degrees of freedom |
281 |
< |
|
282 |
< |
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 |
< |
|
280 |
> |
double eta[3][3]; |
281 |
> |
double oldEta[3][3]; |
282 |
> |
double prevEta[3][3]; |
283 |
|
}; |
284 |
|
|
285 |
< |
template<typename T> class NPTf : public T{ |
285 |
> |
template<typename T> class NPTxyz : public T{ |
286 |
|
|
287 |
|
public: |
288 |
|
|
289 |
< |
NPTf ( SimInfo *theInfo, ForceFields* the_ff); |
290 |
< |
virtual ~NPTf(); |
289 |
> |
NPTxyz ( SimInfo *theInfo, ForceFields* the_ff); |
290 |
> |
virtual ~NPTxyz(); |
291 |
|
|
292 |
|
virtual double getConservedQuantity(void); |
293 |
|
virtual void resetIntegrator(void); |
310 |
|
double oldEta[3][3]; |
311 |
|
double prevEta[3][3]; |
312 |
|
}; |
333 |
– |
|
334 |
– |
template<typename T> class NPTxym : public T{ |
335 |
– |
|
336 |
– |
public: |
337 |
– |
|
338 |
– |
NPTxym ( SimInfo *theInfo, ForceFields* the_ff); |
339 |
– |
virtual ~NPTxym() {}; |
340 |
– |
|
341 |
– |
virtual void integrateStep( int calcPot, int calcStress ){ |
342 |
– |
calcStress = 1; |
343 |
– |
T::integrateStep( calcPot, calcStress ); |
344 |
– |
} |
313 |
|
|
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;} |
314 |
|
|
351 |
– |
protected: |
352 |
– |
|
353 |
– |
virtual void moveA( void ); |
354 |
– |
virtual void moveB( void ); |
355 |
– |
|
356 |
– |
virtual int readyCheck(); |
357 |
– |
|
358 |
– |
virtual void resetIntegrator( void ); |
359 |
– |
|
360 |
– |
Molecule* myMolecules; |
361 |
– |
Atom** myAtoms; |
362 |
– |
|
363 |
– |
// chi and eta are the propagated degrees of freedom |
364 |
– |
|
365 |
– |
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 |
– |
|
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 |
485 |
– |
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 |
|
|
495 |
– |
int totNumOfUnconsAtoms; //total number of uncontraint atoms |
437 |
|
|
438 |
+ |
|
439 |
|
int whichDirection; //constraint direction |
440 |
|
|
441 |
|
private: |