--- trunk/OOPSE/libmdtools/Thermo.cpp 2003/08/20 22:23:34 708 +++ trunk/OOPSE/libmdtools/Thermo.cpp 2003/09/09 20:35:25 755 @@ -166,7 +166,52 @@ double Thermo::getPressure() { return pressure; } +double Thermo::getPressureX() { + // Relies on the calculation of the full molecular pressure tensor + + const double p_convert = 1.63882576e8; + double press[3][3]; + double pressureX; + + this->getPressureTensor(press); + + pressureX = p_convert * press[0][0]; + + return pressureX; +} + +double Thermo::getPressureY() { + + // Relies on the calculation of the full molecular pressure tensor + + const double p_convert = 1.63882576e8; + double press[3][3]; + double pressureY; + + this->getPressureTensor(press); + + pressureY = p_convert * press[1][1]; + + return pressureY; +} + +double Thermo::getPressureZ() { + + // Relies on the calculation of the full molecular pressure tensor + + const double p_convert = 1.63882576e8; + double press[3][3]; + double pressureZ; + + this->getPressureTensor(press); + + pressureZ = p_convert * press[2][2]; + + return pressureZ; +} + + void Thermo::getPressureTensor(double press[3][3]){ // returns pressure tensor in units amu*fs^-2*Ang^-1 // routine derived via viral theorem description in: