--- trunk/OOPSE/libmdtools/Thermo.cpp 2003/07/02 21:26:55 572 +++ trunk/OOPSE/libmdtools/Thermo.cpp 2003/07/08 20:56:10 574 @@ -151,11 +151,23 @@ double Thermo::getVolume() { } double Thermo::getVolume() { - return entry_plug->boxVol; + + double volume; + double Hmat[9]; + + entry_plug->getBoxM(Hmat); + + // volume = h1 (dot) h2 (cross) h3 + + volume = Hmat[0] * ( (Hmat[4]*Hmat[8]) - (Hmat[7]*Hmat[5]) ) + + Hmat[1] * ( (Hmat[5]*Hmat[6]) - (Hmat[8]*Hmat[3]) ) + + Hmat[2] * ( (Hmat[3]*Hmat[7]) - (Hmat[6]*Hmat[4]) ); + + return volume; } double Thermo::getPressure() { - // returns the pressure in units of atm + // Relies on the calculation of the full molecular pressure tensor const double p_convert = 1.63882576e8;