--- branches/mmeineke/OOPSE/libmdtools/ForceFields.cpp 2003/03/21 17:42:12 377 +++ trunk/OOPSE/libmdtools/ForceFields.cpp 2003/03/27 21:07:14 428 @@ -2,6 +2,7 @@ #ifdef IS_MPI #include +#include #endif // is_mpi @@ -11,6 +12,27 @@ #include "fortranWrappers.hpp" +void ForceFields::calcRcut( void ){ + +#ifdef IS_MPI + double tempBig = bigSigma; + MPI::COMM_WORLD.Allreduce( &tempBig, &bigSigma, 1, MPI_DOUBLE, MPI_MAX ); +#endif //is_mpi + + //calc rCut and rList + + entry_plug->rCut = 2.5 * bigSigma; + if(entry_plug->rCut > (entry_plug->box_x / 2.0)) + entry_plug->rCut = entry_plug->box_x / 2.0; + if(entry_plug->rCut > (entry_plug->box_y / 2.0)) + entry_plug->rCut = entry_plug->box_y / 2.0; + if(entry_plug->rCut > (entry_plug->box_z / 2.0)) + entry_plug->rCut = entry_plug->box_z / 2.0; + + entry_plug->rList = entry_plug->rCut + 1.0; + +} + void ForceFields::doForces( int calcPot, int calcStress ){ int i, isError; @@ -31,16 +53,22 @@ void ForceFields::doForces( int calcPot, int calcStres entry_plug->atoms[i]->zeroForces(); } + 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(); - tau = entry_plug->tau; - + + isError = 0; entry_plug->lrPot = 0.0; + + fortranForceLoop( pos, A, u_l,