--- trunk/OOPSE/libmdtools/Integrator.cpp 2003/09/23 20:34:31 782 +++ trunk/OOPSE/libmdtools/Integrator.cpp 2003/10/28 16:03:37 829 @@ -1,6 +1,6 @@ #include -#include -#include +#include +#include #ifdef IS_MPI #include "mpiSimulation.hpp" @@ -146,7 +146,6 @@ template void Integrator::integrate(voi template void Integrator::integrate(void){ - int i, j; // loop counters double runTime = info->run_time; double sampleTime = info->sampleTime; @@ -161,18 +160,18 @@ template void Integrator::integrate(voi double currReset; int calcPot, calcStress; - int isError; tStats = new Thermo(info); statOut = new StatWriter(info); dumpOut = new DumpWriter(info); atoms = info->atoms; - DirectionalAtom* dAtom; dt = info->dt; dt2 = 0.5 * dt; + readyCheck(); + // initialize the forces before the first step calcForce(1, 1); @@ -198,7 +197,7 @@ template void Integrator::integrate(voi dumpOut->writeDump(info->getTime()); statOut->writeStat(info->getTime()); - readyCheck(); + #ifdef IS_MPI strcpy(checkPointMsg, "The integrator is ready to go."); @@ -247,8 +246,10 @@ template void Integrator::integrate(voi #endif // is_mpi } - dumpOut->writeFinal(info->getTime()); + // write the last frame + dumpOut->writeDump(info->getTime()); + delete dumpOut; delete statOut; } @@ -403,7 +404,7 @@ template void Integrator::constrainA(){ } template void Integrator::constrainA(){ - int i, j, k; + int i, j; int done; double posA[3], posB[3]; double velA[3], velB[3]; @@ -547,7 +548,7 @@ template void Integrator::constrainB(vo } template void Integrator::constrainB(void){ - int i, j, k; + int i, j; int done; double posA[3], posB[3]; double velA[3], velB[3]; @@ -556,8 +557,7 @@ template void Integrator::constrainB(vo int a, b, ax, ay, az, bx, by, bz; double rma, rmb; double dx, dy, dz; - double rabsq, pabsq, rvab; - double diffsq; + double rvab; double gab; int iteration;