--- trunk/OOPSE/libmdtools/ExtendedSystem.cpp 2003/04/08 21:35:49 481 +++ trunk/OOPSE/libmdtools/ExtendedSystem.cpp 2003/04/09 04:06:43 483 @@ -84,7 +84,7 @@ void ExtendedSystem::NoseHooverAndersonNPT( double dt, void ExtendedSystem::NoseHooverAndersonNPT( double dt, double ke, - double p_int ) { + double p_tensor[9] ) { // Basic barostating via Hoover, Phys.Rev.A, 1985, Vol. 31 (5) 1695-1697 // Hoover, Phys.Rev.A, 1986, Vol.34 (3) 2499-2500 @@ -106,21 +106,22 @@ void ExtendedSystem::NoseHooverAndersonNPT( double dt, atoms = entry_plug->atoms; p_ext = targetPressure * p_units; - p_mol = p_int * p_units; - + p_mol = (p_tensor[0] + p_tensor[4] + p_tensor[8])/3.0; + entry_plug->getBox(oldBox); volume = oldBox[0]*oldBox[1]*oldBox[2]; ke_temp = ke * e_convert; NkBT = (double)entry_plug->ndf * kB * targetTemp; - // propogate the strain rate + // propagate the strain rate epsilonDot += dt * ((p_mol - p_ext) * volume / (tauBarostat*tauBarostat * kB * targetTemp) ); // determine the change in cell volume scale = pow( (1.0 + dt * 3.0 * epsilonDot), (1.0 / 3.0)); + std::cerr << "pmol = " << p_mol << " p_ext = " << p_ext << " scale = " << scale << "\n"; newBox[0] = oldBox[0] * scale; newBox[1] = oldBox[1] * scale; @@ -251,7 +252,7 @@ short int ExtendedSystem::NVTready() { } } - return 0; + return 1; } short int ExtendedSystem::NPTready() { @@ -299,6 +300,6 @@ short int ExtendedSystem::NPTready() { simError(); } } - return 0; + return 1; }