--- trunk/OOPSE/libmdtools/Thermo.cpp 2004/05/24 21:03:30 1192 +++ trunk/OOPSE/libmdtools/Thermo.cpp 2004/06/07 14:09:02 1251 @@ -200,37 +200,24 @@ void Thermo::getPressureTensor(double press[3][3]){ const double e_convert = 4.184e-4; double molmass, volume; - double vcom[3], pcom[3], fcom[3], scaled[3]; + double vcom[3]; double p_local[9], p_global[9]; - int i, j, k, nMols; - Molecule* molecules; + int i, j, k; - nMols = info->n_mol; - molecules = info->molecules; - //tau = info->tau; - // use velocities of molecular centers of mass and molecular masses: + for (i=0; i < 9; i++) { p_local[i] = 0.0; p_global[i] = 0.0; } + // use velocities of integrableObjects and their masses: + for (i=0; i < info->integrableObjects.size(); i++) { molmass = info->integrableObjects[i]->getMass(); info->integrableObjects[i]->getVel(vcom); - info->integrableObjects[i]->getPos(pcom); - info->integrableObjects[i]->getFrc(fcom); - - matVecMul3(info->HmatInv, pcom, scaled); - - for(j=0; j<3; j++) - scaled[j] -= roundMe(scaled[j]); - - // calc the wrapped real coordinates from the wrapped scaled coordinates - - matVecMul3(info->Hmat, scaled, pcom); p_local[0] += molmass * (vcom[0] * vcom[0]); p_local[1] += molmass * (vcom[0] * vcom[1]); @@ -245,7 +232,7 @@ void Thermo::getPressureTensor(double press[3][3]){ } // Get total for entire system from MPI. - + #ifdef IS_MPI MPI_Allreduce(p_local,p_global,9,MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); #else