--- trunk/OOPSE/libmdtools/Integrator.cpp 2003/07/21 16:23:10 641 +++ trunk/OOPSE/libmdtools/Integrator.cpp 2003/08/11 19:41:36 677 @@ -11,7 +11,7 @@ Integrator::Integrator( SimInfo *theInfo, ForceFields* #include "simError.h" -Integrator::Integrator( SimInfo *theInfo, ForceFields* the_ff ){ +template Integrator::Integrator( SimInfo *theInfo, ForceFields* the_ff ) { info = theInfo; myFF = the_ff; @@ -41,7 +41,7 @@ Integrator::~Integrator() { checkConstraints(); } -Integrator::~Integrator() { +template Integrator::~Integrator() { if( nConstrained ){ delete[] constrainedA; @@ -54,7 +54,7 @@ void Integrator::checkConstraints( void ){ } -void Integrator::checkConstraints( void ){ +template void Integrator::checkConstraints( void ){ isConstrained = 0; @@ -155,7 +155,7 @@ void Integrator::integrate( void ){ } -void Integrator::integrate( void ){ +template void Integrator::integrate( void ){ int i, j; // loop counters @@ -183,11 +183,11 @@ void Integrator::integrate( void ){ // initialize the forces before the first step - myFF->doForces(1,1); + calcForce(1, 1); if( info->setTemp ){ - tStats->velocitize(); + thermalize(); } calcPot = 0; @@ -196,8 +196,8 @@ void Integrator::integrate( void ){ currThermal = thermalTime; currStatus = statusTime; - dumpOut->writeDump( info->currTime ); - statOut->writeStat( info->currTime ); + dumpOut->writeDump( info->getTime() ); + statOut->writeStat( info->getTime() ); readyCheck(); @@ -207,32 +207,31 @@ void Integrator::integrate( void ){ MPIcheckPoint(); #endif // is_mpi - while( info->currTime < runTime ){ + while( info->getTime() < runTime ){ - if( (info->currTime+dt) >= currStatus ){ + if( (info->getTime()+dt) >= currStatus ){ calcPot = 1; calcStress = 1; } integrateStep( calcPot, calcStress ); - info->currTime += dt; - info->setTime(info->currTime); + info->incrTime(dt); if( info->setTemp ){ - if( info->currTime >= currThermal ){ - tStats->velocitize(); + if( info->getTime() >= currThermal ){ + thermalize(); currThermal += thermalTime; } } - if( info->currTime >= currSample ){ - dumpOut->writeDump( info->currTime ); + if( info->getTime() >= currSample ){ + dumpOut->writeDump( info->getTime() ); currSample += sampleTime; } - if( info->currTime >= currStatus ){ - statOut->writeStat( info->currTime ); + if( info->getTime() >= currStatus ){ + statOut->writeStat( info->getTime() ); calcPot = 0; calcStress = 0; currStatus += statusTime; @@ -246,13 +245,13 @@ void Integrator::integrate( void ){ } - dumpOut->writeFinal(info->currTime); + dumpOut->writeFinal(info->getTime()); delete dumpOut; delete statOut; } -void Integrator::integrateStep( int calcPot, int calcStress ){ +template void Integrator::integrateStep( int calcPot, int calcStress ){ @@ -271,7 +270,7 @@ void Integrator::integrateStep( int calcPot, int calcS // calc forces - myFF->doForces(calcPot,calcStress); + calcForce(calcPot,calcStress); #ifdef IS_MPI strcpy( checkPointMsg, "Succesful doForces\n" ); @@ -293,7 +292,7 @@ void Integrator::moveA( void ){ } -void Integrator::moveA( void ){ +template void Integrator::moveA( void ){ int i, j; DirectionalAtom* dAtom; @@ -372,7 +371,7 @@ void Integrator::moveB( void ){ } -void Integrator::moveB( void ){ +template void Integrator::moveB( void ){ int i, j; DirectionalAtom* dAtom; double Tb[3], ji[3]; @@ -414,7 +413,7 @@ void Integrator::preMove( void ){ } } -void Integrator::preMove( void ){ +template void Integrator::preMove( void ){ int i, j; double pos[3]; @@ -432,7 +431,7 @@ void Integrator::constrainA(){ } } -void Integrator::constrainA(){ +template void Integrator::constrainA(){ int i,j,k; int done; @@ -583,7 +582,7 @@ void Integrator::constrainB( void ){ } -void Integrator::constrainB( void ){ +template void Integrator::constrainB( void ){ int i,j,k; int done; @@ -692,7 +691,7 @@ void Integrator::rotate( int axes1, int axes2, double } -void Integrator::rotate( int axes1, int axes2, double angle, double ji[3], +template void Integrator::rotate( int axes1, int axes2, double angle, double ji[3], double A[3][3] ){ int i,j,k; @@ -773,3 +772,12 @@ void Integrator::rotate( int axes1, int axes2, double } } } + +template void Integrator::calcForce( int calcPot, int calcStress ){ + myFF->doForces(calcPot,calcStress); + +} + +template void Integrator::thermalize(){ + tStats->velocitize(); +}