23 |
|
NPT::NPT(SimInfo* info) : |
24 |
|
VelocityVerletIntegrator(info), chiTolerance(1e-6), etaTolerance(1e-6) { |
25 |
|
|
26 |
< |
Globals* globals = info_->getGlobals(); |
26 |
> |
Globals* simParams = info_->getSimParams(); |
27 |
|
|
28 |
< |
if (globals->getUseInitXSstate()) { |
28 |
> |
if (simParams->getUseInitXSstate()) { |
29 |
|
Snapshot* currSnapshot = info_->getSnapshotManager()->getCurrentSnapshot(); |
30 |
|
currSnapshot->setChi(0.0); |
31 |
|
currSnapshot->setIntegralOfChiDt(0.0); |
32 |
|
currSnapshot->setEta(Mat3x3d(0.0)); |
33 |
|
} |
34 |
|
|
35 |
< |
if (!globals->haveTargetTemp()) { |
35 |
> |
if (!simParams->haveTargetTemp()) { |
36 |
|
sprintf(painCave.errMsg, "You can't use the NVT integrator without a targetTemp!\n"); |
37 |
|
painCave.isFatal = 1; |
38 |
|
painCave.severity = OOPSE_ERROR; |
39 |
|
simError(); |
40 |
|
} else { |
41 |
< |
targetTemp = globals->getTargetTemp(); |
41 |
> |
targetTemp = simParams->getTargetTemp(); |
42 |
|
} |
43 |
|
|
44 |
|
// We must set tauThermostat |
45 |
< |
if (!globals->haveTauThermostat()) { |
45 |
> |
if (!simParams->haveTauThermostat()) { |
46 |
|
sprintf(painCave.errMsg, "If you use the constant temperature\n" |
47 |
|
"\tintegrator, you must set tauThermostat_.\n"); |
48 |
|
|
50 |
|
painCave.isFatal = 1; |
51 |
|
simError(); |
52 |
|
} else { |
53 |
< |
tauThermostat = globals->getTauThermostat(); |
53 |
> |
tauThermostat = simParams->getTauThermostat(); |
54 |
|
} |
55 |
|
|
56 |
< |
if (!globals->haveTargetPressure()) { |
56 |
> |
if (!simParams->haveTargetPressure()) { |
57 |
|
sprintf(painCave.errMsg, "NPT error: You can't use the NPT integrator\n" |
58 |
|
" without a targetPressure!\n"); |
59 |
|
|
60 |
|
painCave.isFatal = 1; |
61 |
|
simError(); |
62 |
|
} else { |
63 |
< |
targetPressure = globals->getTargetPressure(); |
63 |
> |
targetPressure = simParams->getTargetPressure(); |
64 |
|
} |
65 |
|
|
66 |
< |
if (!globals->haveTauBarostat()) { |
66 |
> |
if (!simParams->haveTauBarostat()) { |
67 |
|
sprintf(painCave.errMsg, |
68 |
|
"If you use the NPT integrator, you must set tauBarostat.\n"); |
69 |
|
painCave.severity = OOPSE_ERROR; |
70 |
|
painCave.isFatal = 1; |
71 |
|
simError(); |
72 |
|
} else { |
73 |
< |
tauBarostat = globals->getTauBarostat(); |
73 |
> |
tauBarostat = simParams->getTauBarostat(); |
74 |
|
} |
75 |
|
|
76 |
|
tt2 = tauThermostat * tauThermostat; |