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

Comparing branches/new-templateless/OOPSE/libmdtools/NVT.cpp (file contents):
Revision 849 by mmeineke, Fri Oct 31 21:06:47 2003 UTC vs.
Revision 851 by mmeineke, Wed Nov 5 19:18:17 2003 UTC

# Line 1 | Line 1
1 + #include <math.h>
2 +
3   #include "Atom.hpp"
4   #include "SRI.hpp"
5   #include "AbstractClasses.hpp"
# Line 15 | Line 17 | NVT::NVT ( SimInfo *theInfo, ForceFields* the_ff):
17    Integrator( theInfo, the_ff )
18   {
19    GenericData* data;
18  DoubleData * chiValue;
19  DoubleData * integralOfChidtValue;
20  
21  chiValue = NULL;
22  integralOfChidtValue = NULL;
23
21    chi = 0.0;
22    have_tau_thermostat = 0;
23    have_target_temp = 0;
# Line 29 | Line 26 | NVT::NVT ( SimInfo *theInfo, ForceFields* the_ff):
26  
27    // retrieve chi and integralOfChidt from simInfo
28    data = info->getProperty(CHIVALUE_ID);
29 <  if(data){
30 <    chiValue = dynamic_cast<DoubleData*>(data);
29 >  if(data != NULL ){
30 >    chi = data->getDval();
31    }
32  
33    data = info->getProperty(INTEGRALOFCHIDT_ID);
34 <  if(data){
35 <    integralOfChidtValue = dynamic_cast<DoubleData*>(data);
39 <  }
40 <
41 <  // chi and integralOfChidt should appear by pair
42 <  if(chiValue && integralOfChidtValue){
43 <    chi = chiValue->getData();
44 <    integralOfChidt = integralOfChidtValue->getData();
34 >  if(data != NULL ){
35 >    integralOfChidt = data->getDval();
36    }
37  
38    oldVel = new double[3*nAtoms];
# Line 275 | Line 266 | double NVT::getConservedQuantity(void){
266    return conservedQuantity;
267   }
268  
269 < string NVT::getAdditionalParameters(void){
279 <  string parameters;
280 <  const int BUFFERSIZE = 2000; // size of the read buffer
281 <  char buffer[BUFFERSIZE];
269 > char* NVT::getAdditionalParameters(void){
270  
271 <  sprintf(buffer,"\t%g\t%g;", chi, integralOfChidt);
272 <  parameters += buffer;
271 >  sprintf(addParamBuffer,
272 >          "\t%G\t%G;",
273 >          chi, integralOfChidt
274 >          );
275  
276 <  return parameters;
276 >  return addParamBuffer;
277   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines