| 50 |
|
} |
| 51 |
|
} |
| 52 |
|
|
| 53 |
– |
|
| 54 |
– |
std::cerr << "building oldVel with \t" << integrableObjects.size() << "\n"; |
| 53 |
|
oldVel = new double[3*integrableObjects.size()]; |
| 54 |
|
oldJi = new double[3*integrableObjects.size()]; |
| 55 |
|
} |
| 111 |
|
} |
| 112 |
|
} |
| 113 |
|
|
| 114 |
< |
if (nConstrained){ |
| 117 |
< |
constrainA(); |
| 118 |
< |
} |
| 114 |
> |
consFramework->doConstrainA(); |
| 115 |
|
|
| 116 |
|
// Finally, evolve chi a half step (just like a velocity) using |
| 117 |
|
// temperature at time t, not time t+dt/2 |
| 118 |
|
|
| 119 |
< |
std::cerr << "targetTemp = " << targetTemp << " instTemp = " << instTemp << " tauThermostat = " << tauThermostat << " integral of Chi = " << integralOfChidt << "\n"; |
| 119 |
> |
//std::cerr << "targetTemp = " << targetTemp << " instTemp = " << instTemp << " tauThermostat = " << tauThermostat << " integral of Chi = " << integralOfChidt << "\n"; |
| 120 |
|
|
| 121 |
|
chi += dt2 * ( instTemp / targetTemp - 1.0) / (tauThermostat*tauThermostat); |
| 122 |
|
integralOfChidt += chi*dt2; |
| 191 |
|
} |
| 192 |
|
} |
| 193 |
|
|
| 194 |
< |
if (nConstrained){ |
| 199 |
< |
constrainB(); |
| 200 |
< |
} |
| 194 |
> |
consFramework->doConstrainB(); |
| 195 |
|
|
| 196 |
|
if (fabs(prevChi - chi) <= chiTolerance) break; |
| 197 |
|
} |
| 216 |
|
|
| 217 |
|
if (!have_target_temp) { |
| 218 |
|
sprintf( painCave.errMsg, |
| 219 |
< |
"NVT error: You can't use the NVT integrator without a targetTemp!\n" |
| 219 |
> |
"You can't use the NVT integrator without a targetTemp!\n" |
| 220 |
|
); |
| 221 |
|
painCave.isFatal = 1; |
| 222 |
+ |
painCave.severity = OOPSE_ERROR; |
| 223 |
|
simError(); |
| 224 |
|
return -1; |
| 225 |
|
} |
| 228 |
|
|
| 229 |
|
if (!have_tau_thermostat) { |
| 230 |
|
sprintf( painCave.errMsg, |
| 231 |
< |
"NVT error: If you use the constant temperature\n" |
| 232 |
< |
" integrator, you must set tauThermostat.\n"); |
| 231 |
> |
"If you use the constant temperature\n" |
| 232 |
> |
"\tintegrator, you must set tauThermostat.\n"); |
| 233 |
> |
painCave.severity = OOPSE_ERROR; |
| 234 |
|
painCave.isFatal = 1; |
| 235 |
|
simError(); |
| 236 |
|
return -1; |
| 238 |
|
|
| 239 |
|
if (!have_chi_tolerance) { |
| 240 |
|
sprintf( painCave.errMsg, |
| 241 |
< |
"NVT warning: setting chi tolerance to 1e-6\n"); |
| 241 |
> |
"In NVT integrator: setting chi tolerance to 1e-6\n"); |
| 242 |
|
chiTolerance = 1e-6; |
| 243 |
|
have_chi_tolerance = 1; |
| 244 |
+ |
painCave.severity = OOPSE_INFO; |
| 245 |
|
painCave.isFatal = 0; |
| 246 |
|
simError(); |
| 247 |
|
} |
| 258 |
|
double thermostat_kinetic; |
| 259 |
|
double thermostat_potential; |
| 260 |
|
|
| 261 |
< |
fkBT = (double)(info->getNDF() ) * kB * targetTemp; |
| 261 |
> |
fkBT = (double)(info->ndf) * kB * targetTemp; |
| 262 |
|
|
| 263 |
|
Energy = tStats->getTotalE(); |
| 264 |
|
|