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 |
|
|
190 |
|
|
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 |
+ |
double volume; |
206 |
|
|
207 |
|
}; |
208 |
|
|
211 |
|
public: |
212 |
|
|
213 |
|
NPTim ( SimInfo *theInfo, ForceFields* the_ff); |
214 |
< |
virtual ~NPTim() {}; |
214 |
> |
virtual ~NPTim() {} |
215 |
|
|
216 |
|
virtual void integrateStep( int calcPot, int calcStress ){ |
217 |
|
calcStress = 1; |
218 |
|
T::integrateStep( calcPot, calcStress ); |
219 |
+ |
accIntegralOfChidt(); |
220 |
|
} |
221 |
|
|
222 |
+ |
virtual double getConservedQuantity(void); |
223 |
+ |
|
224 |
|
void setTauThermostat(double tt) {tauThermostat = tt; have_tau_thermostat=1;} |
225 |
|
void setTauBarostat(double tb) {tauBarostat = tb; have_tau_barostat=1;} |
226 |
|
void setTargetTemp(double tt) {targetTemp = tt; have_target_temp = 1;} |
227 |
|
void setTargetPressure(double tp) {targetPressure = tp; have_target_pressure = 1;} |
228 |
+ |
void setChiTolerance(double tol) {chiTolerance = tol;} |
229 |
+ |
void setPosIterTolerance(double tol) {posIterTolerance = tol;} |
230 |
|
|
231 |
|
protected: |
232 |
|
|
237 |
|
|
238 |
|
virtual void resetIntegrator( void ); |
239 |
|
|
240 |
+ |
void accIntegralOfChidt(void) { integralOfChidt += dt * chi;} |
241 |
+ |
|
242 |
|
Molecule* myMolecules; |
243 |
|
Atom** myAtoms; |
244 |
|
|
247 |
|
double chi; |
248 |
|
double eta; |
249 |
|
double NkBT; |
250 |
+ |
double integralOfChidt; |
251 |
|
|
252 |
|
// targetTemp, targetPressure, and tauBarostat must be set. |
253 |
|
// One of qmass or tauThermostat must be set; |
259 |
|
|
260 |
|
short int have_tau_thermostat, have_tau_barostat, have_target_temp; |
261 |
|
short int have_target_pressure; |
262 |
+ |
double chiTolerance; |
263 |
+ |
short int have_chi_tolerance; |
264 |
+ |
double posIterTolerance; |
265 |
+ |
short int have_pos_iter_tolerance; |
266 |
|
|
267 |
|
}; |
268 |
|
|
325 |
|
virtual void integrateStep( int calcPot, int calcStress ){ |
326 |
|
calcStress = 1; |
327 |
|
T::integrateStep( calcPot, calcStress ); |
328 |
+ |
accIntegralOfChidt(); |
329 |
|
} |
330 |
+ |
|
331 |
+ |
virtual double getConservedQuantity(void); |
332 |
|
|
333 |
|
void setTauThermostat(double tt) {tauThermostat = tt; have_tau_thermostat=1;} |
334 |
|
void setTauBarostat(double tb) {tauBarostat = tb; have_tau_barostat=1;} |
335 |
|
void setTargetTemp(double tt) {targetTemp = tt; have_target_temp = 1;} |
336 |
|
void setTargetPressure(double tp) {targetPressure = tp; have_target_pressure = 1;} |
337 |
+ |
void setChiTolerance(double tol) {chiTolerance = tol;} |
338 |
+ |
void setPosIterTolerance(double tol) {posIterTolerance = tol;} |
339 |
|
|
340 |
|
protected: |
341 |
|
|
346 |
|
|
347 |
|
virtual int readyCheck(); |
348 |
|
|
349 |
+ |
void accIntegralOfChidt(void) { integralOfChidt += dt * chi;} |
350 |
+ |
|
351 |
|
// chi and eta are the propagated degrees of freedom |
352 |
|
|
353 |
|
double chi; |
354 |
|
double eta[3][3]; |
355 |
|
double NkBT; |
356 |
|
|
357 |
+ |
double integralOfChidt; |
358 |
+ |
|
359 |
|
// targetTemp, targetPressure, and tauBarostat must be set. |
360 |
|
// One of qmass or tauThermostat must be set; |
361 |
|
|
366 |
|
|
367 |
|
short int have_tau_thermostat, have_tau_barostat, have_target_temp; |
368 |
|
short int have_target_pressure; |
369 |
+ |
double chiTolerance; |
370 |
+ |
short int have_chi_tolerance; |
371 |
+ |
double posIterTolerance; |
372 |
+ |
short int have_pos_iter_tolerance; |
373 |
|
|
374 |
|
}; |
375 |
|
|
434 |
|
virtual void integrateStep( int calcPot, int calcStress ){ |
435 |
|
calcStress = 1; |
436 |
|
T::integrateStep( calcPot, calcStress ); |
437 |
+ |
accIntegralOfChidt(); |
438 |
|
} |
439 |
|
|
440 |
+ |
virtual double getConservedQuantity(void); |
441 |
+ |
|
442 |
|
void setTauThermostat(double tt) {tauThermostat = tt; have_tau_thermostat=1;} |
443 |
|
void setTauBarostat(double tb) {tauBarostat = tb; have_tau_barostat=1;} |
444 |
|
void setTargetTemp(double tt) {targetTemp = tt; have_target_temp = 1;} |
445 |
|
void setTargetPressure(double tp) {targetPressure = tp; have_target_pressure = 1;} |
446 |
+ |
void setChiTolerance(double tol) {chiTolerance = tol;} |
447 |
+ |
void setPosIterTolerance(double tol) {posIterTolerance = tol;} |
448 |
|
|
449 |
|
protected: |
450 |
|
|
455 |
|
|
456 |
|
virtual int readyCheck(); |
457 |
|
|
458 |
+ |
void accIntegralOfChidt(void) { integralOfChidt += dt * chi;} |
459 |
+ |
|
460 |
|
Molecule* myMolecules; |
461 |
|
Atom** myAtoms; |
462 |
|
|
465 |
|
double chi; |
466 |
|
double eta[3][3]; |
467 |
|
double NkBT; |
468 |
+ |
double integralOfChidt; |
469 |
|
|
470 |
|
// targetTemp, targetPressure, and tauBarostat must be set. |
471 |
|
// One of qmass or tauThermostat must be set; |
477 |
|
|
478 |
|
short int have_tau_thermostat, have_tau_barostat, have_target_temp; |
479 |
|
short int have_target_pressure; |
480 |
+ |
double chiTolerance; |
481 |
+ |
short int have_chi_tolerance; |
482 |
+ |
double posIterTolerance; |
483 |
+ |
short int have_pos_iter_tolerance; |
484 |
|
|
485 |
|
}; |
486 |
|
|
501 |
|
void setTauBarostat(double tb) {tauBarostat = tb; have_tau_barostat=1;} |
502 |
|
void setTargetTemp(double tt) {targetTemp = tt; have_target_temp = 1;} |
503 |
|
void setTargetPressure(double tp) {targetPressure = tp; have_target_pressure = 1;} |
504 |
+ |
void setChiTolerance(double tol) {chiTolerance = tol;} |
505 |
+ |
void setPosIterTolerance(double tol) {posIterTolerance = tol;} |
506 |
|
|
507 |
|
protected: |
508 |
|
|
529 |
|
|
530 |
|
short int have_tau_thermostat, have_tau_barostat, have_target_temp; |
531 |
|
short int have_target_pressure; |
532 |
+ |
double chiTolerance; |
533 |
+ |
short int have_chi_tolerance; |
534 |
+ |
double posIterTolerance; |
535 |
+ |
short int have_pos_iter_tolerance; |
536 |
|
|
537 |
|
}; |
538 |
|
|
565 |
|
virtual double getHFOfUnconsMols(Atom* atom, double totalForce); |
566 |
|
|
567 |
|
private: |
568 |
< |
int totNumOfMovingAtoms; |
568 |
> |
int totNumOfMovingAtoms; |
569 |
|
}; |
570 |
|
|
571 |
|
class PolicyByMass : public ForceSubtractionPolicy{ |