| 193 |
|
simError(); |
| 194 |
|
} |
| 195 |
|
|
| 196 |
< |
// collect the atomic forces onto rigid bodies |
| 197 |
< |
for(i=0; i<entry_plug->n_mol; i++ ){ |
| 198 |
< |
entry_plug->molecules[i].atoms2rigidBodies(); |
| 199 |
< |
} |
| 200 |
< |
|
| 201 |
< |
if (entry_plug->useSolidThermInt && !entry_plug->useLiquidThermInt) { |
| 202 |
< |
|
| 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++) |
| 206 |
|
} |
| 207 |
|
entry_plug->vRaw = entry_plug->lrPot; |
| 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 |
|
|
| 218 |
– |
if (entry_plug->useLiquidThermInt) { |
| 219 |
– |
|
| 220 |
– |
factor = pow(entry_plug->thermIntLambda, entry_plug->thermIntK); |
| 221 |
– |
for (i=0; i < entry_plug->n_atoms; i++) { |
| 222 |
– |
for (j=0; j< 3; j++) |
| 223 |
– |
frc[3*i + j] *= factor; |
| 224 |
– |
if (entry_plug->atoms[i]->isDirectional()) { |
| 225 |
– |
for (j=0; j< 3; j++) |
| 226 |
– |
trq[3*i + j] *= factor; |
| 227 |
– |
} |
| 228 |
– |
} |
| 229 |
– |
entry_plug->vRaw = entry_plug->lrPot; |
| 230 |
– |
entry_plug->lrPot *= factor; |
| 231 |
– |
} |
| 222 |
|
|
| 223 |
|
#ifdef IS_MPI |
| 224 |
|
sprintf( checkPointMsg, |