47 |
|
|
48 |
|
zetaScale = zeta * dt; |
49 |
|
|
50 |
< |
std::cerr << "zetaScale = " << zetaScale << "\n"; |
50 |
> |
//std::cerr << "zetaScale = " << zetaScale << "\n"; |
51 |
|
|
52 |
|
// perform thermostat scaling on linear velocities and angular momentum |
53 |
|
for(i = 0; i < entry_plug->n_atoms; i++){ |
84 |
|
|
85 |
|
void ExtendedSystem::NoseHooverAndersonNPT( double dt, |
86 |
|
double ke, |
87 |
< |
double p_int ) { |
87 |
> |
double p_tensor[9] ) { |
88 |
|
|
89 |
|
// Basic barostating via Hoover, Phys.Rev.A, 1985, Vol. 31 (5) 1695-1697 |
90 |
|
// Hoover, Phys.Rev.A, 1986, Vol.34 (3) 2499-2500 |
106 |
|
atoms = entry_plug->atoms; |
107 |
|
|
108 |
|
p_ext = targetPressure * p_units; |
109 |
< |
p_mol = p_int * p_units; |
110 |
< |
|
109 |
> |
p_mol = (p_tensor[0] + p_tensor[4] + p_tensor[8])/3.0; |
110 |
> |
|
111 |
|
entry_plug->getBox(oldBox); |
112 |
|
volume = oldBox[0]*oldBox[1]*oldBox[2]; |
113 |
|
|
114 |
|
ke_temp = ke * e_convert; |
115 |
|
NkBT = (double)entry_plug->ndf * kB * targetTemp; |
116 |
|
|
117 |
< |
// propogate the strain rate |
117 |
> |
// propagate the strain rate |
118 |
|
|
119 |
|
epsilonDot += dt * ((p_mol - p_ext) * volume / |
120 |
|
(tauBarostat*tauBarostat * kB * targetTemp) ); |
121 |
|
|
122 |
|
// determine the change in cell volume |
123 |
|
scale = pow( (1.0 + dt * 3.0 * epsilonDot), (1.0 / 3.0)); |
124 |
+ |
//std::cerr << "pmol = " << p_mol << " p_ext = " << p_ext << " scale = " << scale << "\n"; |
125 |
|
|
126 |
|
newBox[0] = oldBox[0] * scale; |
127 |
|
newBox[1] = oldBox[1] * scale; |
141 |
|
zeta += dt * ( (ke_temp*2.0 - NkBT) / qmass ); |
142 |
|
zetaScale = zeta * dt; |
143 |
|
|
144 |
< |
std::cerr << "zetaScale = " << zetaScale << " epsilonScale = " << epsilonScale << "\n"; |
144 |
> |
//std::cerr << "zetaScale = " << zetaScale << " epsilonScale = " << epsilonScale << "\n"; |
145 |
|
|
146 |
|
// apply barostating and thermostating to velocities and angular momenta |
147 |
|
for(i = 0; i < entry_plug->n_atoms; i++){ |
252 |
|
} |
253 |
|
} |
254 |
|
|
255 |
< |
return 0; |
255 |
> |
return 1; |
256 |
|
} |
257 |
|
|
258 |
|
short int ExtendedSystem::NPTready() { |
300 |
|
simError(); |
301 |
|
} |
302 |
|
} |
303 |
< |
return 0; |
303 |
> |
return 1; |
304 |
|
} |
305 |
|
|