43 |
|
update(); |
44 |
|
} |
45 |
|
|
46 |
< |
void NVT::update() { |
46 |
> |
void NVT::doUpdate() { |
47 |
|
oldVel_.resize(info_->getNIntegrableObjects()); |
48 |
|
oldJi_.resize(info_->getNIntegrableObjects()); |
49 |
|
} |
59 |
|
Vector3d pos; |
60 |
|
Vector3d frc; |
61 |
|
|
62 |
< |
Snapshot* currSnapshot = info_->getSnapshotManager()->getCurrentSnapshot(); |
63 |
< |
double chi = currSnapshot->getChi(); |
64 |
< |
double integralOfChidt = currSnapshot->getIntegralOfChiDt(); |
62 |
> |
double chi = currentSnapshot_->getChi(); |
63 |
> |
double integralOfChidt = currentSnapshot_->getIntegralOfChiDt(); |
64 |
|
|
65 |
|
// We need the temperature at time = t for the chi update below: |
66 |
|
|
117 |
|
chi += dt2 * (instTemp / targetTemp_ - 1.0) / (tauThermostat_ * tauThermostat_); |
118 |
|
integralOfChidt += chi * dt2; |
119 |
|
|
120 |
< |
currSnapshot->setChi(chi); |
121 |
< |
currSnapshot->setIntegralOfChiDt(integralOfChidt); |
120 |
> |
currentSnapshot_->setChi(chi); |
121 |
> |
currentSnapshot_->setIntegralOfChiDt(integralOfChidt); |
122 |
|
} |
123 |
|
|
124 |
|
void NVT::moveB() { |
136 |
|
int index; |
137 |
|
// Set things up for the iteration: |
138 |
|
|
139 |
< |
Snapshot* currSnapshot = info_->getSnapshotManager()->getCurrentSnapshot(); |
141 |
< |
double chi = currSnapshot->getChi(); |
139 |
> |
double chi = currentSnapshot_->getChi(); |
140 |
|
double oldChi = chi; |
141 |
|
double prevChi; |
142 |
< |
double integralOfChidt = currSnapshot->getIntegralOfChiDt(); |
142 |
> |
double integralOfChidt = currentSnapshot_->getIntegralOfChiDt(); |
143 |
|
|
144 |
|
index = 0; |
145 |
|
for (mol = info_->beginMolecule(i); mol != NULL; mol = info_->nextMolecule(i)) { |
207 |
|
|
208 |
|
integralOfChidt += dt2 * chi; |
209 |
|
|
210 |
< |
currSnapshot->setChi(chi); |
211 |
< |
currSnapshot->setIntegralOfChiDt(integralOfChidt); |
210 |
> |
currentSnapshot_->setChi(chi); |
211 |
> |
currentSnapshot_->setIntegralOfChiDt(integralOfChidt); |
212 |
|
} |
213 |
|
|
214 |
|
|
215 |
|
double NVT::calcConservedQuantity() { |
216 |
< |
Snapshot* currSnapshot = info_->getSnapshotManager()->getCurrentSnapshot(); |
217 |
< |
double chi = currSnapshot->getChi(); |
218 |
< |
double integralOfChidt = currSnapshot->getIntegralOfChiDt(); |
216 |
> |
|
217 |
> |
double chi = currentSnapshot_->getChi(); |
218 |
> |
double integralOfChidt = currentSnapshot_->getIntegralOfChiDt(); |
219 |
|
double conservedQuantity; |
220 |
|
double fkBT; |
221 |
|
double Energy; |