--- trunk/OOPSE/libmdtools/ForceFields.cpp 2003/07/02 21:26:55 572 +++ trunk/OOPSE/libmdtools/ForceFields.cpp 2003/12/22 21:27:04 892 @@ -3,13 +3,17 @@ using namespace std; using namespace std; -#include +#include #ifdef IS_MPI #include #endif // is_mpi +#ifdef PROFILE +#include "mdProfile.hpp" +#endif + #include "simError.h" #include "ForceFields.hpp" #include "Atom.hpp" @@ -26,16 +30,8 @@ void ForceFields::calcRcut( void ){ //calc rCut and rList - entry_plug->rCut = 2.5 * bigSigma; - if(entry_plug->rCut > (entry_plug->boxLx / 2.0)) - entry_plug->rCut = entry_plug->boxLx / 2.0; - if(entry_plug->rCut > (entry_plug->boxLy / 2.0)) - entry_plug->rCut = entry_plug->boxLy / 2.0; - if(entry_plug->rCut > (entry_plug->boxLz / 2.0)) - entry_plug->rCut = entry_plug->boxLz / 2.0; - - entry_plug->rList = entry_plug->rCut + 1.0; - + entry_plug->setDefaultRcut( 2.5 * bigSigma ); + } void ForceFields::doForces( int calcPot, int calcStress ){ @@ -46,7 +42,7 @@ void ForceFields::doForces( int calcPot, int calcStres double* trq; double* A; double* u_l;; - DirectionalAtom* dAtom; + SimState* config; short int passedCalcPot = (short int)calcPot; short int passedCalcStress = (short int)calcStress; @@ -58,16 +54,26 @@ void ForceFields::doForces( int calcPot, int calcStres entry_plug->atoms[i]->zeroForces(); } +#ifdef PROFILE + startProfile(pro7); +#endif + for(i=0; in_mol; i++ ){ entry_plug->molecules[i].calcForces(); } - frc = Atom::getFrcArray(); - pos = Atom::getPosArray(); - trq = Atom::getTrqArray(); - A = Atom::getAmatArray(); - u_l = Atom::getUlArray(); +#ifdef PROFILE + endProfile( pro7 ); +#endif + config = entry_plug->getConfiguration(); + + frc = config->getFrcArray(); + pos = config->getPosArray(); + trq = config->getTrqArray(); + A = config->getAmatArray(); + u_l = config->getUlArray(); + isError = 0; entry_plug->lrPot = 0.0; @@ -75,6 +81,11 @@ void ForceFields::doForces( int calcPot, int calcStres entry_plug->tau[i] = 0.0; } + +#ifdef PROFILE + startProfile(pro8); +#endif + fortranForceLoop( pos, A, u_l, @@ -86,6 +97,11 @@ void ForceFields::doForces( int calcPot, int calcStres &passedCalcStress, &isError ); +#ifdef PROFILE + endProfile(pro8); +#endif + + if( isError ){ sprintf( painCave.errMsg, "Error returned from the fortran force calculation.\n" ); @@ -98,6 +114,7 @@ void ForceFields::doForces( int calcPot, int calcStres "returned from the force calculation.\n" ); MPIcheckPoint(); #endif // is_mpi + }