ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/Thermo.cpp
(Generate patch)

Comparing trunk/OOPSE/libmdtools/Thermo.cpp (file contents):
Revision 468 by gezelter, Mon Apr 7 16:56:38 2003 UTC vs.
Revision 475 by gezelter, Tue Apr 8 12:44:18 2003 UTC

# Line 140 | Line 140 | double Thermo::getPressure(){
140    // Paci, E. and Marchi, M. J.Phys.Chem. 1996, 100, 4314-4322
141  
142    const double convert = 4.184e-4;
143 <  double mtot;
143 >  double molmass;
144    double vcom[3];
145    double p_local, p_sum, p_mol, virial;
146    double theBox[3];
# Line 154 | Line 154 | double Thermo::getPressure(){
154  
155    // use velocities of molecular centers of mass and molecular masses:
156    p_local = 0.0;
157 +
158    for (i=0; i < nMols; i++) {
159 <    molecules[i].getCOMvel(mtot, vcom);
160 <    p_local += mtot* (vcom[0]*vcom[0] + vcom[1]*vcom[1] + vcom[2]*vcom[2]);
159 >    molmass = molecules[i].getCOMvel(vcom);
160 >    p_local += (vcom[0]*vcom[0] + vcom[1]*vcom[1] + vcom[2]*vcom[2]) * molmass;
161    }
162  
163    // Get total for entire system from MPI.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines