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

Comparing trunk/OOPSE/libmdtools/NPTfm.cpp (file contents):
Revision 658 by tim, Thu Jul 31 15:35:07 2003 UTC vs.
Revision 763 by tim, Mon Sep 15 16:52:02 2003 UTC

# Line 10 | Line 10
10   #include "Integrator.hpp"
11   #include "simError.h"
12  
13 +
14   // Basic non-isotropic thermostating and barostating via the Melchionna
15   // modification of the Hoover algorithm:
16   //
# Line 28 | Line 29 | template<typename T> NPTfm<T>::NPTfm ( SimInfo *theInf
29   {
30    int i, j;
31    chi = 0.0;
32 <
32 >  integralOfChidt = 0.0;
33 >  
34    for(i = 0; i < 3; i++)
35      for (j = 0; j < 3; j++)
36        eta[i][j] = 0.0;
# Line 328 | Line 330 | template<typename T> void NPTfm<T>::moveB( void ){
330    }
331   }
332  
333 + template<typename T> void NPTfm<T>::resetIntegrator() {
334 +  int i,j;
335 +  
336 +  chi = 0.0;
337 +
338 +  for(i = 0; i < 3; i++)
339 +    for (j = 0; j < 3; j++)
340 +      eta[i][j] = 0.0;
341 + }
342 +
343   template<typename T> int NPTfm<T>::readyCheck() {
344  
345    //check parent's readyCheck() first
# Line 384 | Line 396 | template<typename T> int NPTfm<T>::readyCheck() {
396    NkBT = (double)info->ndf * kB * targetTemp;
397  
398    return 1;
399 + }
400 +
401 + template<typename T> double NPTfm<T>::getConservedQuantity(void){
402 +
403 +  double conservedQuantity;
404 +  double tb2;
405 +  double trEta;
406 +
407 +  //HNVE
408 +  conservedQuantity = tStats->getTotalE();
409 +
410 +  //HNVT
411 +  conservedQuantity += (info->getNDF() * kB * targetTemp *
412 +                        (integralOfChidt + tauThermostat * tauThermostat * chi * chi / 2.0)) / eConvert ;
413 +
414 +  //HNPT
415 +  tb2 = tauBarostat *tauBarostat;
416 +
417 +  trEta = info->matTrace3(eta);
418 +  
419 +  conservedQuantity += (targetPressure * tStats->getVolume() / p_convert +
420 +                        3*NkBT/2 * tb2 * trEta * trEta) / eConvert;
421 +  
422 +  return conservedQuantity;
423   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines