65 |
|
oldPos = new double[3*integrableObjects.size()]; |
66 |
|
oldVel = new double[3*integrableObjects.size()]; |
67 |
|
oldJi = new double[3*integrableObjects.size()]; |
68 |
– |
#ifdef IS_MPI |
69 |
– |
Nparticles = mpiSim->getTotAtoms(); |
70 |
– |
#else |
71 |
– |
Nparticles = theInfo->n_atoms; |
72 |
– |
#endif |
68 |
|
|
69 |
|
} |
70 |
|
|
165 |
|
integrableObjects[i]->setPos( pos ); |
166 |
|
} |
167 |
|
|
168 |
< |
if (nConstrained){ |
174 |
< |
constrainA(); |
175 |
< |
} |
168 |
> |
consFramework->doConstrainA(); |
169 |
|
} |
170 |
|
|
171 |
|
|
245 |
|
} |
246 |
|
} |
247 |
|
|
248 |
< |
if (nConstrained){ |
256 |
< |
constrainB(); |
257 |
< |
} |
248 |
> |
consFramework->doConstrainA(); |
249 |
|
|
250 |
|
if ( this->chiConverged() && this->etaConverged() ) break; |
251 |
|
} |
321 |
|
|
322 |
|
if (!have_tau_barostat) { |
323 |
|
sprintf( painCave.errMsg, |
324 |
< |
"NPT error: If you use the NPT\n" |
325 |
< |
" integrator, you must set tauBarostat.\n"); |
324 |
> |
"If you use the NPT integrator, you must set tauBarostat.\n"); |
325 |
> |
painCave.severity = OOPSE_ERROR; |
326 |
|
painCave.isFatal = 1; |
327 |
|
simError(); |
328 |
|
return -1; |
330 |
|
|
331 |
|
if (!have_chi_tolerance) { |
332 |
|
sprintf( painCave.errMsg, |
333 |
< |
"NPT warning: setting chi tolerance to 1e-6\n"); |
333 |
> |
"Setting chi tolerance to 1e-6 in NPT integrator\n"); |
334 |
|
chiTolerance = 1e-6; |
335 |
|
have_chi_tolerance = 1; |
336 |
+ |
painCave.severity = OOPSE_INFO; |
337 |
|
painCave.isFatal = 0; |
338 |
|
simError(); |
339 |
|
} |
340 |
|
|
341 |
|
if (!have_eta_tolerance) { |
342 |
|
sprintf( painCave.errMsg, |
343 |
< |
"NPT warning: setting eta tolerance to 1e-6\n"); |
343 |
> |
"Setting eta tolerance to 1e-6 in NPT integrator"); |
344 |
|
etaTolerance = 1e-6; |
345 |
|
have_eta_tolerance = 1; |
346 |
+ |
painCave.severity = OOPSE_INFO; |
347 |
|
painCave.isFatal = 0; |
348 |
|
simError(); |
349 |
|
} |
350 |
|
|
351 |
|
// We need NkBT a lot, so just set it here: This is the RAW number |
352 |
< |
// of particles, so no subtraction or addition of constraints or |
352 |
> |
// of integrableObjects, so no subtraction or addition of constraints or |
353 |
|
// orientational degrees of freedom: |
354 |
|
|
355 |
< |
NkBT = (double)Nparticles * kB * targetTemp; |
355 |
> |
NkBT = (double)(info->getTotIntegrableObjects()) * kB * targetTemp; |
356 |
|
|
357 |
|
// fkBT is used because the thermostat operates on more degrees of freedom |
358 |
|
// than the barostat (when there are particles with orientational degrees |
359 |
< |
// of freedom). ndf = 3 * (n_atoms + n_oriented -1) - n_constraint - nZcons |
359 |
> |
// of freedom). |
360 |
|
|
361 |
< |
fkBT = (double)info->ndf * kB * targetTemp; |
361 |
> |
fkBT = (double)(info->getNDF()) * kB * targetTemp; |
362 |
|
|
363 |
|
tt2 = tauThermostat * tauThermostat; |
364 |
|
tb2 = tauBarostat * tauBarostat; |