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

Comparing trunk/OOPSE/libmdtools/NVT.cpp (file contents):
Revision 837 by tim, Wed Oct 29 00:19:10 2003 UTC vs.
Revision 855 by mmeineke, Thu Nov 6 22:01:37 2003 UTC

# Line 1 | Line 1
1 + #include <math.h>
2 +
3   #include "Atom.hpp"
4   #include "SRI.hpp"
5   #include "AbstractClasses.hpp"
# Line 27 | Line 29 | template<typename T> NVT<T>::NVT ( SimInfo *theInfo, F
29    have_chi_tolerance = 0;
30    integralOfChidt = 0.0;
31  
30  // retrieve chi and integralOfChidt from simInfo
31  data = info->getProperty(CHIVALUE_ID);
32  if(data){
33    chiValue = dynamic_cast<DoubleData*>(data);
34  }
32  
33 <  data = info->getProperty(INTEGRALOFCHIDT_ID);
37 <  if(data){
38 <    integralOfChidtValue = dynamic_cast<DoubleData*>(data);
39 <  }
33 >  if( theInfo->useInitXSstate ){
34  
35 <  // chi and integralOfChidt should appear by pair
36 <  if(chiValue && integralOfChidtValue){
37 <    chi = chiValue->getData();
38 <    integralOfChidt = integralOfChidtValue->getData();
35 >    // retrieve chi and integralOfChidt from simInfo
36 >    data = info->getProperty(CHIVALUE_ID);
37 >    if(data){
38 >      chiValue = dynamic_cast<DoubleData*>(data);
39 >    }
40 >    
41 >    data = info->getProperty(INTEGRALOFCHIDT_ID);
42 >    if(data){
43 >      integralOfChidtValue = dynamic_cast<DoubleData*>(data);
44 >    }
45 >    
46 >    // chi and integralOfChidt should appear by pair
47 >    if(chiValue && integralOfChidtValue){
48 >      chi = chiValue->getData();
49 >      integralOfChidt = integralOfChidtValue->getData();
50 >    }
51    }
52  
53    oldVel = new double[3*nAtoms];
# Line 269 | Line 275 | template<typename T> double NVT<T>::getConservedQuanti
275  
276    conservedQuantity = Energy + thermostat_kinetic + thermostat_potential;
277  
272  cerr << info->getTime() << "\t" << Energy << "\t" << thermostat_kinetic <<
273      "\t" << thermostat_potential << "\t" << conservedQuantity << endl;
274
278    return conservedQuantity;
279   }
280  
# Line 280 | Line 283 | template<typename T> string NVT<T>::getAdditionalParam
283    const int BUFFERSIZE = 2000; // size of the read buffer
284    char buffer[BUFFERSIZE];
285  
286 <  sprintf(buffer,"\t%g\t%g;", chi, integralOfChidt);
286 >  sprintf(buffer,"\t%G\t%G;", chi, integralOfChidt);
287    parameters += buffer;
288  
289    return parameters;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines