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