| 96 |
|
p_mol = p_int; |
| 97 |
|
|
| 98 |
|
entry_plug->getBox(oldBox); |
| 99 |
– |
|
| 99 |
|
volume = oldBox[0]*oldBox[1]*oldBox[2]; |
| 100 |
|
|
| 101 |
|
ke_temp = ke * e_convert; |
| 107 |
|
(tauRelax*tauRelax * kB * targetTemp) ); |
| 108 |
|
|
| 109 |
|
|
| 110 |
< |
std::cerr << "p_mol = " << p_mol << " p_ext = " << p_ext << " volume = " << volume << " tauRelax = " << tauRelax << "\n"; |
| 110 |
> |
std::cerr << "dt = " << dt << " tauRelax = " << tauRelax << " kB = " << kB << "targetTemp = " << targetTemp << "\n"; |
| 111 |
|
|
| 113 |
– |
|
| 112 |
|
// determine the change in cell volume |
| 113 |
|
scale = pow( (1.0 + dt * 3.0 * epsilonDot), (1.0 / 3.0)); |
| 114 |
|
|
| 115 |
+ |
std::cerr << "p_mol = " << p_mol << " p_ext = " << p_ext << " scale = " << scale << "\n"; |
| 116 |
+ |
|
| 117 |
+ |
|
| 118 |
|
newBox[0] = oldBox[0] * scale; |
| 119 |
|
newBox[1] = oldBox[1] * scale; |
| 120 |
|
newBox[2] = oldBox[2] * scale; |
| 172 |
|
double r[3]; |
| 173 |
|
double boxNum[3]; |
| 174 |
|
double percentScale[3]; |
| 175 |
+ |
double delta[3]; |
| 176 |
|
double rxi, ryi, rzi; |
| 177 |
|
|
| 178 |
|
molecules = entry_plug->molecules; |
| 185 |
|
for (i=0; i < entry_plug->n_mol; i++) { |
| 186 |
|
|
| 187 |
|
molecules[i].getCOM(r); |
| 188 |
< |
|
| 188 |
> |
|
| 189 |
|
// find the minimum image coordinates of the molecular centers of mass: |
| 190 |
|
|
| 191 |
|
boxNum[0] = oldBox[0] * copysign(1.0,r[0]) * |
| 206 |
|
ryi += ryi*percentScale[1]; |
| 207 |
|
rzi += rzi*percentScale[2]; |
| 208 |
|
|
| 209 |
< |
r[0] = rxi + boxNum[0]; |
| 210 |
< |
r[1] = ryi + boxNum[1]; |
| 211 |
< |
r[2] = rzi + boxNum[2]; |
| 209 |
> |
delta[0] = r[0] - (rxi + boxNum[0]); |
| 210 |
> |
delta[1] = r[1] - (ryi + boxNum[1]); |
| 211 |
> |
delta[2] = r[2] - (rzi + boxNum[2]); |
| 212 |
|
|
| 213 |
< |
molecules[i].moveCOM(r); |
| 213 |
> |
molecules[i].moveCOM(delta); |
| 214 |
|
} |
| 215 |
|
} |