27 |
|
Integrator( SimInfo *theInfo, ForceFields* the_ff ); |
28 |
|
virtual ~Integrator(); |
29 |
|
void integrate( void ); |
30 |
+ |
virtual double getConservedQuantity(void); |
31 |
|
|
31 |
– |
|
32 |
|
protected: |
33 |
|
|
34 |
|
virtual void integrateStep( int calcPot, int calcStress ); |
40 |
|
virtual int readyCheck( void ) { return 1; } |
41 |
|
|
42 |
|
virtual void resetIntegrator( void ) { } |
43 |
< |
|
43 |
> |
|
44 |
|
virtual void calcForce( int calcPot, int calcStress ); |
45 |
|
virtual void thermalize(); |
46 |
|
|
95 |
|
public: |
96 |
|
|
97 |
|
NVT ( SimInfo *theInfo, ForceFields* the_ff); |
98 |
< |
virtual ~NVT() {} |
98 |
> |
virtual ~NVT(); |
99 |
|
|
100 |
|
void setTauThermostat(double tt) {tauThermostat = tt; have_tau_thermostat=1;} |
101 |
|
void setTargetTemp(double tt) {targetTemp = tt; have_target_temp = 1;} |
102 |
+ |
void setChiTolerance(double tol) {chiTolerance = tol;} |
103 |
+ |
virtual double getConservedQuantity(void); |
104 |
|
|
105 |
|
protected: |
106 |
|
|
115 |
|
|
116 |
|
double chi; |
117 |
|
|
118 |
+ |
//integral of chi(t)dt |
119 |
+ |
double integralOfChidt; |
120 |
+ |
|
121 |
|
// targetTemp must be set. tauThermostat must also be set; |
122 |
|
|
123 |
|
double targetTemp; |
125 |
|
|
126 |
|
short int have_tau_thermostat, have_target_temp; |
127 |
|
|
128 |
+ |
double *oldVel; |
129 |
+ |
double *oldJi; |
130 |
+ |
|
131 |
+ |
double chiTolerance; |
132 |
+ |
short int have_chi_tolerance; |
133 |
+ |
|
134 |
|
}; |
135 |
|
|
136 |
|
|
140 |
|
public: |
141 |
|
|
142 |
|
NPTi ( SimInfo *theInfo, ForceFields* the_ff); |
143 |
< |
virtual ~NPTi() {}; |
144 |
< |
|
143 |
> |
virtual ~NPTi(); |
144 |
> |
|
145 |
|
virtual void integrateStep( int calcPot, int calcStress ){ |
146 |
|
calcStress = 1; |
147 |
|
T::integrateStep( calcPot, calcStress ); |
148 |
+ |
/* accIntegralOfChidt(); */ |
149 |
|
} |
150 |
|
|
151 |
+ |
virtual double getConservedQuantity(void); |
152 |
+ |
|
153 |
|
void setTauThermostat(double tt) {tauThermostat = tt; have_tau_thermostat=1;} |
154 |
|
void setTauBarostat(double tb) {tauBarostat = tb; have_tau_barostat=1;} |
155 |
|
void setTargetTemp(double tt) {targetTemp = tt; have_target_temp = 1;} |
156 |
|
void setTargetPressure(double tp) {targetPressure = tp; have_target_pressure = 1;} |
157 |
+ |
void setChiTolerance(double tol) {chiTolerance = tol; have_chi_tolerance = 1;} |
158 |
+ |
void setPosIterTolerance(double tol) {posIterTolerance = tol; have_pos_iter_tolerance = 1;} |
159 |
+ |
void setEtaTolerance(double tol) {etaTolerance = tol; have_eta_tolerance = 1;} |
160 |
|
|
161 |
|
protected: |
162 |
|
|
167 |
|
|
168 |
|
virtual void resetIntegrator( void ); |
169 |
|
|
170 |
+ |
void accIntegralOfChidt(void) { integralOfChidt += dt * chi;} |
171 |
+ |
|
172 |
|
// chi and eta are the propagated degrees of freedom |
173 |
|
|
174 |
|
double chi; |
175 |
|
double eta; |
176 |
|
double NkBT; |
177 |
+ |
double fkBT; |
178 |
|
|
179 |
+ |
int Nparticles; |
180 |
+ |
|
181 |
+ |
double integralOfChidt; |
182 |
+ |
|
183 |
|
// targetTemp, targetPressure, and tauBarostat must be set. |
184 |
|
// One of qmass or tauThermostat must be set; |
185 |
|
|
191 |
|
short int have_tau_thermostat, have_tau_barostat, have_target_temp; |
192 |
|
short int have_target_pressure; |
193 |
|
|
194 |
+ |
double *oldPos; |
195 |
+ |
double *oldVel; |
196 |
+ |
double *oldJi; |
197 |
+ |
|
198 |
+ |
double chiTolerance; |
199 |
+ |
short int have_chi_tolerance; |
200 |
+ |
double posIterTolerance; |
201 |
+ |
short int have_pos_iter_tolerance; |
202 |
+ |
double etaTolerance; |
203 |
+ |
short int have_eta_tolerance; |
204 |
+ |
|
205 |
|
}; |
206 |
|
|
207 |
|
template<typename T> class NPTim : public T{ |
209 |
|
public: |
210 |
|
|
211 |
|
NPTim ( SimInfo *theInfo, ForceFields* the_ff); |
212 |
< |
virtual ~NPTim() {}; |
212 |
> |
virtual ~NPTim() {} |
213 |
|
|
214 |
|
virtual void integrateStep( int calcPot, int calcStress ){ |
215 |
|
calcStress = 1; |
216 |
|
T::integrateStep( calcPot, calcStress ); |
217 |
+ |
accIntegralOfChidt(); |
218 |
|
} |
219 |
|
|
220 |
+ |
virtual double getConservedQuantity(void); |
221 |
+ |
|
222 |
|
void setTauThermostat(double tt) {tauThermostat = tt; have_tau_thermostat=1;} |
223 |
|
void setTauBarostat(double tb) {tauBarostat = tb; have_tau_barostat=1;} |
224 |
|
void setTargetTemp(double tt) {targetTemp = tt; have_target_temp = 1;} |
225 |
|
void setTargetPressure(double tp) {targetPressure = tp; have_target_pressure = 1;} |
226 |
+ |
void setChiTolerance(double tol) {chiTolerance = tol;} |
227 |
+ |
void setPosIterTolerance(double tol) {posIterTolerance = tol;} |
228 |
|
|
229 |
|
protected: |
230 |
|
|
235 |
|
|
236 |
|
virtual void resetIntegrator( void ); |
237 |
|
|
238 |
+ |
void accIntegralOfChidt(void) { integralOfChidt += dt * chi;} |
239 |
+ |
|
240 |
|
Molecule* myMolecules; |
241 |
|
Atom** myAtoms; |
242 |
|
|
245 |
|
double chi; |
246 |
|
double eta; |
247 |
|
double NkBT; |
248 |
+ |
double integralOfChidt; |
249 |
|
|
250 |
|
// targetTemp, targetPressure, and tauBarostat must be set. |
251 |
|
// One of qmass or tauThermostat must be set; |
257 |
|
|
258 |
|
short int have_tau_thermostat, have_tau_barostat, have_target_temp; |
259 |
|
short int have_target_pressure; |
260 |
+ |
double chiTolerance; |
261 |
+ |
short int have_chi_tolerance; |
262 |
+ |
double posIterTolerance; |
263 |
+ |
short int have_pos_iter_tolerance; |
264 |
|
|
265 |
|
}; |
266 |
|
|
318 |
|
public: |
319 |
|
|
320 |
|
NPTf ( SimInfo *theInfo, ForceFields* the_ff); |
321 |
< |
virtual ~NPTf() {}; |
321 |
> |
virtual ~NPTf(); |
322 |
|
|
323 |
|
virtual void integrateStep( int calcPot, int calcStress ){ |
324 |
|
calcStress = 1; |
325 |
|
T::integrateStep( calcPot, calcStress ); |
326 |
|
} |
327 |
+ |
|
328 |
+ |
virtual double getConservedQuantity(void); |
329 |
|
|
330 |
|
void setTauThermostat(double tt) {tauThermostat = tt; have_tau_thermostat=1;} |
331 |
|
void setTauBarostat(double tb) {tauBarostat = tb; have_tau_barostat=1;} |
332 |
|
void setTargetTemp(double tt) {targetTemp = tt; have_target_temp = 1;} |
333 |
|
void setTargetPressure(double tp) {targetPressure = tp; have_target_pressure = 1;} |
334 |
+ |
void setChiTolerance(double tol) {chiTolerance = tol;} |
335 |
+ |
void setPosIterTolerance(double tol) {posIterTolerance = tol;} |
336 |
|
|
337 |
|
protected: |
338 |
|
|
343 |
|
|
344 |
|
virtual int readyCheck(); |
345 |
|
|
346 |
+ |
|
347 |
|
// chi and eta are the propagated degrees of freedom |
348 |
|
|
349 |
|
double chi; |
350 |
|
double eta[3][3]; |
351 |
|
double NkBT; |
352 |
+ |
double fkBT; |
353 |
|
|
354 |
+ |
int Nparticles; |
355 |
+ |
|
356 |
+ |
double *oldPos; |
357 |
+ |
double *oldVel; |
358 |
+ |
double *oldJi; |
359 |
+ |
|
360 |
+ |
double integralOfChidt; |
361 |
+ |
|
362 |
|
// targetTemp, targetPressure, and tauBarostat must be set. |
363 |
|
// One of qmass or tauThermostat must be set; |
364 |
|
|
369 |
|
|
370 |
|
short int have_tau_thermostat, have_tau_barostat, have_target_temp; |
371 |
|
short int have_target_pressure; |
372 |
< |
|
372 |
> |
double chiTolerance; |
373 |
> |
short int have_chi_tolerance; |
374 |
> |
double posIterTolerance; |
375 |
> |
short int have_pos_iter_tolerance; |
376 |
> |
double etaTolerance; |
377 |
> |
short int have_eta_tolerance; |
378 |
|
}; |
379 |
|
|
380 |
|
template<typename T> class NPTxym : public T{ |
438 |
|
virtual void integrateStep( int calcPot, int calcStress ){ |
439 |
|
calcStress = 1; |
440 |
|
T::integrateStep( calcPot, calcStress ); |
441 |
+ |
accIntegralOfChidt(); |
442 |
|
} |
443 |
|
|
444 |
+ |
virtual double getConservedQuantity(void); |
445 |
+ |
|
446 |
|
void setTauThermostat(double tt) {tauThermostat = tt; have_tau_thermostat=1;} |
447 |
|
void setTauBarostat(double tb) {tauBarostat = tb; have_tau_barostat=1;} |
448 |
|
void setTargetTemp(double tt) {targetTemp = tt; have_target_temp = 1;} |
449 |
|
void setTargetPressure(double tp) {targetPressure = tp; have_target_pressure = 1;} |
450 |
+ |
void setChiTolerance(double tol) {chiTolerance = tol;} |
451 |
+ |
void setPosIterTolerance(double tol) {posIterTolerance = tol;} |
452 |
|
|
453 |
|
protected: |
454 |
|
|
459 |
|
|
460 |
|
virtual int readyCheck(); |
461 |
|
|
462 |
+ |
void accIntegralOfChidt(void) { integralOfChidt += dt * chi;} |
463 |
+ |
|
464 |
|
Molecule* myMolecules; |
465 |
|
Atom** myAtoms; |
466 |
|
|
469 |
|
double chi; |
470 |
|
double eta[3][3]; |
471 |
|
double NkBT; |
472 |
+ |
double integralOfChidt; |
473 |
|
|
474 |
|
// targetTemp, targetPressure, and tauBarostat must be set. |
475 |
|
// One of qmass or tauThermostat must be set; |
481 |
|
|
482 |
|
short int have_tau_thermostat, have_tau_barostat, have_target_temp; |
483 |
|
short int have_target_pressure; |
484 |
+ |
double chiTolerance; |
485 |
+ |
short int have_chi_tolerance; |
486 |
+ |
double posIterTolerance; |
487 |
+ |
short int have_pos_iter_tolerance; |
488 |
|
|
489 |
|
}; |
490 |
|
|
505 |
|
void setTauBarostat(double tb) {tauBarostat = tb; have_tau_barostat=1;} |
506 |
|
void setTargetTemp(double tt) {targetTemp = tt; have_target_temp = 1;} |
507 |
|
void setTargetPressure(double tp) {targetPressure = tp; have_target_pressure = 1;} |
508 |
+ |
void setChiTolerance(double tol) {chiTolerance = tol;} |
509 |
+ |
void setPosIterTolerance(double tol) {posIterTolerance = tol;} |
510 |
|
|
511 |
|
protected: |
512 |
|
|
533 |
|
|
534 |
|
short int have_tau_thermostat, have_tau_barostat, have_target_temp; |
535 |
|
short int have_target_pressure; |
536 |
+ |
double chiTolerance; |
537 |
+ |
short int have_chi_tolerance; |
538 |
+ |
double posIterTolerance; |
539 |
+ |
short int have_pos_iter_tolerance; |
540 |
|
|
541 |
|
}; |
542 |
|
|
569 |
|
virtual double getHFOfUnconsMols(Atom* atom, double totalForce); |
570 |
|
|
571 |
|
private: |
572 |
< |
int totNumOfMovingAtoms; |
572 |
> |
int totNumOfMovingAtoms; |
573 |
|
}; |
574 |
|
|
575 |
|
class PolicyByMass : public ForceSubtractionPolicy{ |