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 763 by tim, Mon Sep 15 16:52:02 2003 UTC vs.
Revision 853 by mmeineke, Thu Nov 6 19:11:38 2003 UTC

# Line 1 | Line 1
1 < #include <cmath>
1 > #include <math.h>
2   #include <iostream>
3   using namespace std;
4  
# Line 104 | Line 104 | double Thermo::getPotential(){
104    potential = potential_local;
105   #endif // is_mpi
106  
107 #ifdef IS_MPI
108  /*
109  std::cerr << "node " << worldRank << ": after pot = " << potential << "\n";
110  */
111 #endif
112
107    return potential;
108   }
109  
# Line 130 | Line 124 | double Thermo::getEnthalpy() {
124    return temperature;
125   }
126  
133 double Thermo::getEnthalpy() {
134
135  const double e_convert = 4.184E-4; // convert kcal/mol -> (amu A^2)/fs^2
136  double u, p, v;
137  double press[3][3];
138
139  u = this->getTotalE();
140
141  this->getPressureTensor(press);
142  p = (press[0][0] + press[1][1] + press[2][2]) / 3.0;
143
144  v = this->getVolume();
145
146  return (u + (p*v)/e_convert);
147 }
148
127   double Thermo::getVolume() {
128  
129    return info->boxVol;
# Line 272 | Line 250 | void Thermo::velocitize() {
250  
251   void Thermo::velocitize() {
252    
275  double x,y;
253    double aVel[3], aJ[3], I[3][3];
254    int i, j, vr, vd; // velocity randomizer loop counters
255    double vdrift[3];
# Line 302 | Line 279 | void Thermo::velocitize() {
279  
280      av2 = 2.0 * kebar / atoms[vr]->getMass();
281      vbar = sqrt( av2 );
282 <
306 < //     vbar = sqrt( 8.31451e-7 * temperature / atoms[vr]->getMass() );
307 <    
282 >
283      // picks random velocities from a gaussian distribution
284      // centered on vbar
285  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines