| 1 | 
  | 
#include <iostream> | 
| 2 | 
< | 
#include <cstdlib> | 
| 3 | 
< | 
#include <cmath> | 
| 2 | 
> | 
#include <stdlib.h> | 
| 3 | 
> | 
#include <math.h> | 
| 4 | 
  | 
 | 
| 5 | 
  | 
#ifdef IS_MPI | 
| 6 | 
  | 
#include "mpiSimulation.hpp" | 
| 25 | 
  | 
  if (info->the_integrator != NULL){ | 
| 26 | 
  | 
    delete info->the_integrator; | 
| 27 | 
  | 
  } | 
| 28 | 
< | 
  info->the_integrator = this; | 
| 29 | 
< | 
 | 
| 28 | 
> | 
   | 
| 29 | 
  | 
  nAtoms = info->n_atoms; | 
| 30 | 
  | 
 | 
| 31 | 
  | 
  // check for constraints | 
| 146 | 
  | 
 | 
| 147 | 
  | 
 | 
| 148 | 
  | 
template<typename T> void Integrator<T>::integrate(void){ | 
| 150 | 
– | 
  int i, j;                         // loop counters | 
| 149 | 
  | 
 | 
| 150 | 
  | 
  double runTime = info->run_time; | 
| 151 | 
  | 
  double sampleTime = info->sampleTime; | 
| 160 | 
  | 
  double currReset; | 
| 161 | 
  | 
   | 
| 162 | 
  | 
  int calcPot, calcStress; | 
| 165 | 
– | 
  int isError; | 
| 163 | 
  | 
 | 
| 164 | 
  | 
  tStats = new Thermo(info); | 
| 165 | 
  | 
  statOut = new StatWriter(info); | 
| 166 | 
  | 
  dumpOut = new DumpWriter(info); | 
| 167 | 
  | 
 | 
| 168 | 
  | 
  atoms = info->atoms; | 
| 172 | 
– | 
  DirectionalAtom* dAtom; | 
| 169 | 
  | 
 | 
| 170 | 
  | 
  dt = info->dt; | 
| 171 | 
  | 
  dt2 = 0.5 * dt; | 
| 172 | 
  | 
 | 
| 173 | 
+ | 
  readyCheck(); | 
| 174 | 
+ | 
 | 
| 175 | 
  | 
  // initialize the forces before the first step | 
| 176 | 
  | 
 | 
| 177 | 
  | 
  calcForce(1, 1); | 
| 197 | 
  | 
  dumpOut->writeDump(info->getTime()); | 
| 198 | 
  | 
  statOut->writeStat(info->getTime()); | 
| 199 | 
  | 
 | 
| 202 | 
– | 
  readyCheck(); | 
| 200 | 
  | 
 | 
| 201 | 
+ | 
 | 
| 202 | 
  | 
#ifdef IS_MPI | 
| 203 | 
  | 
  strcpy(checkPointMsg, "The integrator is ready to go."); | 
| 204 | 
  | 
  MPIcheckPoint(); | 
| 246 | 
  | 
#endif // is_mpi | 
| 247 | 
  | 
  } | 
| 248 | 
  | 
 | 
| 251 | 
– | 
  dumpOut->writeFinal(info->getTime()); | 
| 249 | 
  | 
 | 
| 250 | 
+ | 
  // write the last frame | 
| 251 | 
+ | 
  dumpOut->writeDump(info->getTime()); | 
| 252 | 
+ | 
 | 
| 253 | 
  | 
  delete dumpOut; | 
| 254 | 
  | 
  delete statOut; | 
| 255 | 
  | 
} | 
| 404 | 
  | 
} | 
| 405 | 
  | 
 | 
| 406 | 
  | 
template<typename T> void Integrator<T>::constrainA(){ | 
| 407 | 
< | 
  int i, j, k; | 
| 407 | 
> | 
  int i, j; | 
| 408 | 
  | 
  int done; | 
| 409 | 
  | 
  double posA[3], posB[3]; | 
| 410 | 
  | 
  double velA[3], velB[3]; | 
| 548 | 
  | 
} | 
| 549 | 
  | 
 | 
| 550 | 
  | 
template<typename T> void Integrator<T>::constrainB(void){ | 
| 551 | 
< | 
  int i, j, k; | 
| 551 | 
> | 
  int i, j; | 
| 552 | 
  | 
  int done; | 
| 553 | 
  | 
  double posA[3], posB[3]; | 
| 554 | 
  | 
  double velA[3], velB[3]; | 
| 557 | 
  | 
  int a, b, ax, ay, az, bx, by, bz; | 
| 558 | 
  | 
  double rma, rmb; | 
| 559 | 
  | 
  double dx, dy, dz; | 
| 560 | 
< | 
  double rabsq, pabsq, rvab; | 
| 561 | 
< | 
  double diffsq; | 
| 560 | 
> | 
  double rvab; | 
| 561 | 
  | 
  double gab; | 
| 562 | 
  | 
  int iteration; | 
| 563 | 
  | 
 |