193 |
|
simError(); |
194 |
|
} |
195 |
|
|
196 |
< |
if (entry_plug->useSolidThermInt && !entry_plug->useLiquidThermInt) { |
197 |
< |
|
198 |
< |
factor = pow(entry_plug->thermIntLambda, entry_plug->thermIntK); |
199 |
< |
for (i=0; i < entry_plug->n_atoms; i++) { |
200 |
< |
for (j=0; j< 3; j++) |
201 |
< |
frc[3*i + j] *= factor; |
202 |
< |
if (entry_plug->atoms[i]->isDirectional()) { |
203 |
< |
for (j=0; j< 3; j++) |
204 |
< |
trq[3*i + j] *= factor; |
205 |
< |
} |
206 |
< |
} |
207 |
< |
entry_plug->vRaw = entry_plug->lrPot; |
208 |
< |
entry_plug->lrPot *= factor; |
209 |
< |
entry_plug->lrPot += entry_plug->restraint->Calc_Restraint_Forces(entry_plug->integrableObjects); |
210 |
< |
entry_plug->vHarm = entry_plug->restraint->getVharm(); |
211 |
< |
} |
212 |
< |
|
213 |
< |
if (entry_plug->useLiquidThermInt) { |
214 |
< |
|
196 |
> |
// scale forces if thermodynamic integration is used |
197 |
> |
if (entry_plug->useSolidThermInt || entry_plug->useLiquidThermInt) { |
198 |
|
factor = pow(entry_plug->thermIntLambda, entry_plug->thermIntK); |
199 |
|
for (i=0; i < entry_plug->n_atoms; i++) { |
200 |
|
for (j=0; j< 3; j++) |
208 |
|
entry_plug->lrPot *= factor; |
209 |
|
} |
210 |
|
|
211 |
+ |
// collect the atomic forces onto rigid bodies |
212 |
|
for(i=0; i<entry_plug->n_mol; i++ ){ |
213 |
|
entry_plug->molecules[i].atoms2rigidBodies(); |
214 |
|
} |
215 |
|
|
216 |
+ |
// do crystal restraint forces for thermodynamic integration |
217 |
+ |
if (entry_plug->useSolidThermInt){ |
218 |
+ |
entry_plug->lrPot += entry_plug->restraint->Calc_Restraint_Forces(entry_plug->integrableObjects); |
219 |
+ |
entry_plug->vHarm = entry_plug->restraint->getVharm(); |
220 |
+ |
} |
221 |
+ |
|
222 |
|
|
223 |
|
#ifdef IS_MPI |
224 |
|
sprintf( checkPointMsg, |