ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/branches/new_design/OOPSE-3.0/src/brains/Thermo.cpp
(Generate patch)

Comparing branches/new_design/OOPSE-3.0/src/brains/Thermo.cpp (file contents):
Revision 1804 by tim, Tue Nov 30 19:58:25 2004 UTC vs.
Revision 1822 by tim, Thu Dec 2 02:08:29 2004 UTC

# Line 122 | Line 122 | double Thermo::getPressure() {
122      Mat3x3d tensor;
123      double pressure;
124  
125 <    this->getPressureTensor(tensor);
125 >    tensor = getPressureTensor();
126  
127      pressure = OOPSEConstant::pressureConvert * (tensor(0, 0) + tensor(1, 1) + tensor(2, 2)) / 3.0;
128  
129      return pressure;
130   }
131  
132 < void Thermo::getPressureTensor(Mat3x3d pressureTensor) {
132 > Mat3x3d Thermo::getPressureTensor() {
133      // returns pressure tensor in units amu*fs^-2*Ang^-1
134      // routine derived via viral theorem description in:
135      // Paci, E. and Marchi, M. J.Phys.Chem. 1996, 100, 4314-4322
136 <
136 >    Mat3x3d pressureTensor;
137      Mat3x3d p_local(0.0);
138      Mat3x3d p_global(0.0);
139  
# Line 162 | Line 162 | void Thermo::getPressureTensor(Mat3x3d pressureTensor)
162      Mat3x3d tau = curSnapshot->statData.getTau();
163  
164      pressureTensor =  p_global + OOPSEConstant::energyConvert/volume * tau;
165 +
166 +    return pressureTensor;
167   }
168  
169 + void Thermo::saveStat(){
170 +    Snapshot* currSnapshot = info_->getSnapshotManager()->getCurrentSnapshot();
171 +    Stats& stat = currSnapshot->statData;
172 +    
173 +    stat[Stats::KINETIC_ENERGY] = getKinetic();
174 +    stat[Stats::POTENTIAL_ENERGY] = getPotential();
175 +    stat[Stats::TOTAL_ENERGY] = stat[Stats::KINETIC_ENERGY]  + stat[Stats::POTENTIAL_ENERGY] ;
176 +    stat[Stats::TEMPERATURE] = getTemperature();
177 +    stat[Stats::PRESSURE] = getPressure();
178 +    stat[Stats::VOLUME] = getVolume();      
179 +
180 +    /**@todo need refactorying*/
181 +    //Conserved Quantity is set by integrator and time is set by setTime
182 +    
183 + }
184 +
185   } //end namespace oopse

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines