141 |
|
mol = info_->nextMolecule(i)) { |
142 |
|
for (atom = mol->beginFluctuatingCharge(j); atom != NULL; |
143 |
|
atom = mol->nextFluctuatingCharge(j)) { |
144 |
< |
|
145 |
< |
cvel = atom->getFlucQVel(); |
146 |
< |
cfrc = atom->getFlucQFrc(); |
147 |
< |
cmass = atom->getChargeMass(); |
148 |
< |
|
144 |
> |
|
145 |
|
randomForce = randNumGen_.randNorm(0, variance_ ); |
146 |
|
atom->addFlucQFrc(randomForce); |
147 |
|
|
149 |
|
// required is at the full step: v(t + h), while we have |
150 |
|
// initially the velocity at the half step: v(t + h/2). We |
151 |
|
// need to iterate to converge the friction force vector. |
152 |
< |
|
152 |
> |
|
153 |
|
// this is the velocity at the half-step: |
154 |
< |
|
154 |
> |
|
155 |
|
cvel = atom->getFlucQVel(); |
156 |
< |
|
156 |
> |
|
157 |
|
// estimate velocity at full-step using everything but |
158 |
|
// friction forces: |
159 |
|
|
160 |
|
cfrc = atom->getFlucQFrc(); |
161 |
+ |
cmass = atom->getChargeMass(); |
162 |
|
velStep = cvel + dt2_ * cfrc / cmass; |
163 |
< |
|
163 |
> |
|
164 |
|
frictionForce = 0.0; |
165 |
+ |
|
166 |
|
//iteration starts here: |
167 |
|
|
168 |
|
for (int k = 0; k < maxIterNum_; k++) { |