| 36 |
|
* [1] Meineke, et al., J. Comp. Chem. 26, 252-271 (2005). |
| 37 |
|
* [2] Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006). |
| 38 |
|
* [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008). |
| 39 |
< |
* [4] Vardeman & Gezelter, in progress (2009). |
| 39 |
> |
* [4] Kuang & Gezelter, J. Chem. Phys. 133, 164101 (2010). |
| 40 |
> |
* [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). |
| 41 |
|
*/ |
| 42 |
|
|
| 43 |
|
#include "integrators/NVT.hpp" |
| 79 |
|
tauThermostat_ = simParams->getTauThermostat(); |
| 80 |
|
} |
| 81 |
|
|
| 82 |
< |
update(); |
| 82 |
> |
updateSizes(); |
| 83 |
|
} |
| 84 |
|
|
| 85 |
< |
void NVT::doUpdate() { |
| 85 |
> |
void NVT::doUpdateSizes() { |
| 86 |
|
oldVel_.resize(info_->getNIntegrableObjects()); |
| 87 |
< |
oldJi_.resize(info_->getNIntegrableObjects()); |
| 87 |
> |
oldJi_.resize(info_->getNIntegrableObjects()); |
| 88 |
|
} |
| 89 |
|
void NVT::moveA() { |
| 90 |
|
SimInfo::MoleculeIterator i; |
| 137 |
|
|
| 138 |
|
//ji[j] += dt2 * (Tb[j] * PhysicalConstants::energyConvert - ji[j]*chi); |
| 139 |
|
ji += dt2*PhysicalConstants::energyConvert*Tb - dt2*chi *ji; |
| 140 |
< |
rotAlgo->rotate(integrableObject, ji, dt); |
| 140 |
> |
rotAlgo_->rotate(integrableObject, ji, dt); |
| 141 |
|
|
| 142 |
|
integrableObject->setJ(ji); |
| 143 |
|
} |
| 145 |
|
|
| 146 |
|
} |
| 147 |
|
|
| 148 |
< |
rattle->constraintA(); |
| 148 |
> |
flucQ_->moveA(); |
| 149 |
> |
rattle_->constraintA(); |
| 150 |
|
|
| 151 |
|
// Finally, evolve chi a half step (just like a velocity) using |
| 152 |
|
// temperature at time t, not time t+dt/2 |
| 183 |
|
for (mol = info_->beginMolecule(i); mol != NULL; mol = info_->nextMolecule(i)) { |
| 184 |
|
for (integrableObject = mol->beginIntegrableObject(j); integrableObject != NULL; |
| 185 |
|
integrableObject = mol->nextIntegrableObject(j)) { |
| 184 |
– |
oldVel_[index] = integrableObject->getVel(); |
| 185 |
– |
oldJi_[index] = integrableObject->getJ(); |
| 186 |
|
|
| 187 |
+ |
oldVel_[index] = integrableObject->getVel(); |
| 188 |
+ |
|
| 189 |
+ |
if (integrableObject->isDirectional()) |
| 190 |
+ |
oldJi_[index] = integrableObject->getJ(); |
| 191 |
+ |
|
| 192 |
|
++index; |
| 193 |
< |
} |
| 189 |
< |
|
| 193 |
> |
} |
| 194 |
|
} |
| 195 |
|
|
| 196 |
|
// do the iteration: |
| 238 |
|
} |
| 239 |
|
} |
| 240 |
|
|
| 241 |
+ |
rattle_->constraintB(); |
| 242 |
|
|
| 238 |
– |
rattle->constraintB(); |
| 239 |
– |
|
| 243 |
|
if (fabs(prevChi - chi) <= chiTolerance_) |
| 244 |
|
break; |
| 245 |
|
|
| 246 |
|
} |
| 247 |
|
|
| 248 |
< |
integralOfChidt += dt2 * chi; |
| 248 |
> |
flucQ_->moveB(); |
| 249 |
|
|
| 250 |
+ |
integralOfChidt += dt2 * chi; |
| 251 |
|
currentSnapshot_->setChi(chi); |
| 252 |
|
currentSnapshot_->setIntegralOfChiDt(integralOfChidt); |
| 253 |
|
} |