| 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); | 
| 187 | 
< | 
   | 
| 186 | 
> | 
  calcForce(1, 1); | 
| 187 | 
> | 
  // myFF->doForces(1,1); | 
| 188 | 
> | 
         | 
| 189 | 
  | 
  if( info->setTemp ){ | 
| 190 | 
  | 
     | 
| 191 | 
< | 
    tStats->velocitize(); | 
| 191 | 
> | 
    thermalize(); | 
| 192 | 
  | 
  } | 
| 193 | 
  | 
   | 
| 194 | 
  | 
  calcPot     = 0; | 
| 195 | 
  | 
  calcStress  = 0; | 
| 196 | 
< | 
  currSample  = sampleTime; | 
| 197 | 
< | 
  currThermal = thermalTime; | 
| 198 | 
< | 
  currStatus  = statusTime; | 
| 196 | 
> | 
  currSample  = sampleTime + info->getTime(); | 
| 197 | 
> | 
  currThermal = thermalTime+ info->getTime(); | 
| 198 | 
> | 
  currStatus  = statusTime + info->getTime(); | 
| 199 | 
  | 
 | 
| 200 | 
  | 
  dumpOut->writeDump( info->getTime() ); | 
| 201 | 
  | 
  statOut->writeStat( info->getTime() ); | 
| 221 | 
  | 
 | 
| 222 | 
  | 
    if( info->setTemp ){ | 
| 223 | 
  | 
      if( info->getTime() >= currThermal ){ | 
| 224 | 
< | 
        tStats->velocitize(); | 
| 224 | 
> | 
        thermalize(); | 
| 225 | 
  | 
        currThermal += thermalTime; | 
| 226 | 
  | 
      } | 
| 227 | 
  | 
    } | 
| 252 | 
  | 
  delete statOut; | 
| 253 | 
  | 
} | 
| 254 | 
  | 
 | 
| 255 | 
< | 
void Integrator::integrateStep( int calcPot, int calcStress ){ | 
| 255 | 
> | 
template<typename T> void Integrator<T>::integrateStep( int calcPot, int calcStress ){ | 
| 256 | 
  | 
 | 
| 257 | 
  | 
 | 
| 258 | 
  | 
       | 
| 271 | 
  | 
 | 
| 272 | 
  | 
  // calc forces | 
| 273 | 
  | 
 | 
| 274 | 
< | 
  myFF->doForces(calcPot,calcStress); | 
| 274 | 
> | 
  calcForce(calcPot,calcStress); | 
| 275 | 
  | 
 | 
| 276 | 
  | 
#ifdef IS_MPI | 
| 277 | 
  | 
  strcpy( checkPointMsg, "Succesful doForces\n" ); | 
| 293 | 
  | 
} | 
| 294 | 
  | 
 | 
| 295 | 
  | 
 | 
| 296 | 
< | 
void Integrator::moveA( void ){ | 
| 296 | 
> | 
template<typename T> void Integrator<T>::moveA( void ){ | 
| 297 | 
  | 
   | 
| 298 | 
  | 
  int i, j; | 
| 299 | 
  | 
  DirectionalAtom* dAtom; | 
| 372 | 
  | 
} | 
| 373 | 
  | 
 | 
| 374 | 
  | 
 | 
| 375 | 
< | 
void Integrator::moveB( void ){ | 
| 375 | 
> | 
template<typename T> void Integrator<T>::moveB( void ){ | 
| 376 | 
  | 
  int i, j; | 
| 377 | 
  | 
  DirectionalAtom* dAtom; | 
| 378 | 
  | 
  double Tb[3], ji[3]; | 
| 414 | 
  | 
  } | 
| 415 | 
  | 
} | 
| 416 | 
  | 
 | 
| 417 | 
< | 
void Integrator::preMove( void ){ | 
| 417 | 
> | 
template<typename T> void Integrator<T>::preMove( void ){ | 
| 418 | 
  | 
  int i, j; | 
| 419 | 
  | 
  double pos[3]; | 
| 420 | 
  | 
 | 
| 432 | 
  | 
  }   | 
| 433 | 
  | 
} | 
| 434 | 
  | 
 | 
| 435 | 
< | 
void Integrator::constrainA(){ | 
| 435 | 
> | 
template<typename T> void Integrator<T>::constrainA(){ | 
| 436 | 
  | 
 | 
| 437 | 
  | 
  int i,j,k; | 
| 438 | 
  | 
  int done; | 
| 583 | 
  | 
 | 
| 584 | 
  | 
} | 
| 585 | 
  | 
 | 
| 586 | 
< | 
void Integrator::constrainB( void ){ | 
| 586 | 
> | 
template<typename T> void Integrator<T>::constrainB( void ){ | 
| 587 | 
  | 
   | 
| 588 | 
  | 
  int i,j,k; | 
| 589 | 
  | 
  int done; | 
| 692 | 
  | 
 | 
| 693 | 
  | 
} | 
| 694 | 
  | 
 | 
| 695 | 
< | 
void Integrator::rotate( int axes1, int axes2, double angle, double ji[3],  | 
| 695 | 
> | 
template<typename T> void Integrator<T>::rotate( int axes1, int axes2, double angle, double ji[3],  | 
| 696 | 
  | 
                         double A[3][3] ){ | 
| 697 | 
  | 
 | 
| 698 | 
  | 
  int i,j,k; | 
| 773 | 
  | 
    } | 
| 774 | 
  | 
  } | 
| 775 | 
  | 
} | 
| 776 | 
+ | 
 | 
| 777 | 
+ | 
template<typename T> void Integrator<T>::calcForce( int calcPot, int calcStress ){ | 
| 778 | 
+ | 
   myFF->doForces(calcPot,calcStress); | 
| 779 | 
+ | 
   | 
| 780 | 
+ | 
} | 
| 781 | 
+ | 
 | 
| 782 | 
+ | 
template<typename T> void Integrator<T>::thermalize(){ | 
| 783 | 
+ | 
  tStats->velocitize();   | 
| 784 | 
+ | 
} |