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

Comparing trunk/OOPSE/libmdtools/NPTim.cpp (file contents):
Revision 645 by tim, Tue Jul 22 19:54:52 2003 UTC vs.
Revision 763 by tim, Mon Sep 15 16:52:02 2003 UTC

# Line 29 | Line 29 | template<typename T> NPTim<T>::NPTim ( SimInfo *theInf
29   {
30    chi = 0.0;
31    eta = 0.0;
32 +  integralOfChidt = 0.0;
33    have_tau_thermostat = 0;
34    have_tau_barostat = 0;
35    have_target_temp = 0;
# Line 219 | Line 220 | template<typename T> void NPTim<T>::moveB( void ){
220    }
221   }
222  
223 + template<typename T> void NPTim<T>::resetIntegrator() {
224 +  chi = 0.0;
225 +  eta = 0.0;
226 + }
227 +
228   template<typename T> int NPTim<T>::readyCheck() {
229 +
230 +  //check parent's readyCheck() first
231 +  if (T::readyCheck() == -1)
232 +    return -1;
233  
234    // First check to see if we have a target temperature.
235    // Not having one is fatal.
# Line 271 | Line 281 | template<typename T> int NPTim<T>::readyCheck() {
281    NkBT = (double)info->ndf * kB * targetTemp;
282  
283    return 1;
284 + }
285 +
286 + template<typename T> double NPTim<T>::getConservedQuantity(void){
287 +
288 +  double conservedQuantity;
289 +  double tb2;
290 +  double eta2;  
291 +
292 +
293 +  //HNVE
294 +  conservedQuantity = tStats->getTotalE();
295 +
296 +  //HNVT
297 +  conservedQuantity += (info->getNDF() * kB * targetTemp *
298 +                        (integralOfChidt + tauThermostat * tauThermostat * chi * chi /2))/ eConvert ;
299 +
300 +  //HNPT
301 +  tb2 = tauBarostat *tauBarostat;
302 +  eta2 = eta * eta;
303 +  
304 +  conservedQuantity += (targetPressure * tStats->getVolume() / p_convert +
305 +                        3*NkBT/2 * tb2 * eta2) / eConvert;
306 +  
307 +  return conservedQuantity;
308   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines