| 11 |
|
#include "simError.h" |
| 12 |
|
|
| 13 |
|
|
| 14 |
< |
Integrator::Integrator( SimInfo *theInfo, ForceFields* the_ff ){ |
| 14 |
> |
template<typename T> Integrator<T>::Integrator( SimInfo *theInfo, ForceFields* the_ff ) { |
| 15 |
|
|
| 16 |
|
info = theInfo; |
| 17 |
|
myFF = the_ff; |
| 41 |
|
checkConstraints(); |
| 42 |
|
} |
| 43 |
|
|
| 44 |
< |
Integrator::~Integrator() { |
| 44 |
> |
template<typename T> Integrator<T>::~Integrator() { |
| 45 |
|
|
| 46 |
|
if( nConstrained ){ |
| 47 |
|
delete[] constrainedA; |
| 54 |
|
|
| 55 |
|
} |
| 56 |
|
|
| 57 |
< |
void Integrator::checkConstraints( void ){ |
| 57 |
> |
template<typename T> void Integrator<T>::checkConstraints( void ){ |
| 58 |
|
|
| 59 |
|
|
| 60 |
|
isConstrained = 0; |
| 155 |
|
} |
| 156 |
|
|
| 157 |
|
|
| 158 |
< |
void Integrator::integrate( void ){ |
| 158 |
> |
template<typename T> void Integrator<T>::integrate( void ){ |
| 159 |
|
|
| 160 |
|
int i, j; // loop counters |
| 161 |
|
|
| 183 |
|
|
| 184 |
|
// initialize the forces before the first step |
| 185 |
|
|
| 186 |
< |
myFF->doForces(1,1); |
| 186 |
> |
calcForce(1, 1); |
| 187 |
|
|
| 188 |
|
if( info->setTemp ){ |
| 189 |
|
|
| 190 |
< |
tStats->velocitize(); |
| 190 |
> |
thermalize(); |
| 191 |
|
} |
| 192 |
|
|
| 193 |
|
calcPot = 0; |
| 220 |
|
|
| 221 |
|
if( info->setTemp ){ |
| 222 |
|
if( info->getTime() >= currThermal ){ |
| 223 |
< |
tStats->velocitize(); |
| 223 |
> |
thermalize(); |
| 224 |
|
currThermal += thermalTime; |
| 225 |
|
} |
| 226 |
|
} |
| 251 |
|
delete statOut; |
| 252 |
|
} |
| 253 |
|
|
| 254 |
< |
void Integrator::integrateStep( int calcPot, int calcStress ){ |
| 254 |
> |
template<typename T> void Integrator<T>::integrateStep( int calcPot, int calcStress ){ |
| 255 |
|
|
| 256 |
|
|
| 257 |
|
|
| 270 |
|
|
| 271 |
|
// calc forces |
| 272 |
|
|
| 273 |
< |
myFF->doForces(calcPot,calcStress); |
| 273 |
> |
calcForce(calcPot,calcStress); |
| 274 |
|
|
| 275 |
|
#ifdef IS_MPI |
| 276 |
|
strcpy( checkPointMsg, "Succesful doForces\n" ); |
| 292 |
|
} |
| 293 |
|
|
| 294 |
|
|
| 295 |
< |
void Integrator::moveA( void ){ |
| 295 |
> |
template<typename T> void Integrator<T>::moveA( void ){ |
| 296 |
|
|
| 297 |
|
int i, j; |
| 298 |
|
DirectionalAtom* dAtom; |
| 371 |
|
} |
| 372 |
|
|
| 373 |
|
|
| 374 |
< |
void Integrator::moveB( void ){ |
| 374 |
> |
template<typename T> void Integrator<T>::moveB( void ){ |
| 375 |
|
int i, j; |
| 376 |
|
DirectionalAtom* dAtom; |
| 377 |
|
double Tb[3], ji[3]; |
| 413 |
|
} |
| 414 |
|
} |
| 415 |
|
|
| 416 |
< |
void Integrator::preMove( void ){ |
| 416 |
> |
template<typename T> void Integrator<T>::preMove( void ){ |
| 417 |
|
int i, j; |
| 418 |
|
double pos[3]; |
| 419 |
|
|
| 431 |
|
} |
| 432 |
|
} |
| 433 |
|
|
| 434 |
< |
void Integrator::constrainA(){ |
| 434 |
> |
template<typename T> void Integrator<T>::constrainA(){ |
| 435 |
|
|
| 436 |
|
int i,j,k; |
| 437 |
|
int done; |
| 582 |
|
|
| 583 |
|
} |
| 584 |
|
|
| 585 |
< |
void Integrator::constrainB( void ){ |
| 585 |
> |
template<typename T> void Integrator<T>::constrainB( void ){ |
| 586 |
|
|
| 587 |
|
int i,j,k; |
| 588 |
|
int done; |
| 691 |
|
|
| 692 |
|
} |
| 693 |
|
|
| 694 |
< |
void Integrator::rotate( int axes1, int axes2, double angle, double ji[3], |
| 694 |
> |
template<typename T> void Integrator<T>::rotate( int axes1, int axes2, double angle, double ji[3], |
| 695 |
|
double A[3][3] ){ |
| 696 |
|
|
| 697 |
|
int i,j,k; |
| 772 |
|
} |
| 773 |
|
} |
| 774 |
|
} |
| 775 |
+ |
|
| 776 |
+ |
template<typename T> void Integrator<T>::calcForce( int calcPot, int calcStress ){ |
| 777 |
+ |
myFF->doForces(calcPot,calcStress); |
| 778 |
+ |
|
| 779 |
+ |
} |
| 780 |
+ |
|
| 781 |
+ |
template<typename T> void Integrator<T>::thermalize(){ |
| 782 |
+ |
tStats->velocitize(); |
| 783 |
+ |
} |