| 1 |
+ |
#include <math.h> |
| 2 |
+ |
|
| 3 |
|
#include "Atom.hpp" |
| 4 |
|
#include "SRI.hpp" |
| 5 |
|
#include "AbstractClasses.hpp" |
| 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]; |
| 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 |
|
|
| 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; |