--- trunk/src/brains/ForceManager.cpp 2007/04/06 21:53:43 1126 +++ trunk/src/brains/ForceManager.cpp 2008/05/27 16:39:06 1245 @@ -53,8 +53,8 @@ #define __C #include "UseTheForce/DarkSide/fInteractionMap.h" #include "utils/simError.h" +#include "primitives/Bond.hpp" #include "primitives/Bend.hpp" -#include "primitives/Bend.hpp" namespace oopse { void ForceManager::calcForces(bool needPotential, bool needStress) { @@ -83,18 +83,19 @@ namespace oopse { // forces are zeroed here, before any are accumulated. // NOTE: do not rezero the forces in Fortran. - + for (mol = info_->beginMolecule(mi); mol != NULL; mol = info_->nextMolecule(mi)) { for(atom = mol->beginAtom(ai); atom != NULL; atom = mol->nextAtom(ai)) { atom->zeroForcesAndTorques(); } - + //change the positions of atoms which belong to the rigidbodies for (rb = mol->beginRigidBody(rbIter); rb != NULL; rb = mol->nextRigidBody(rbIter)) { rb->zeroForcesAndTorques(); } + } // Zero out the stress tensor @@ -201,6 +202,7 @@ namespace oopse { RealType* A; RealType* electroFrame; RealType* rc; + RealType* particlePot; //get current snapshot from SimInfo curSnapshot = info_->getSnapshotManager()->getCurrentSnapshot(); @@ -212,6 +214,7 @@ namespace oopse { trq = config->getArrayPointer(DataStorage::dslTorque); A = config->getArrayPointer(DataStorage::dslAmat); electroFrame = config->getArrayPointer(DataStorage::dslElectroFrame); + particlePot = config->getArrayPointer(DataStorage::dslParticlePot); //calculate the center of mass of cutoff group SimInfo::MoleculeIterator mi; @@ -251,18 +254,19 @@ namespace oopse { longRangePotential[i]=0.0; //Initialize array } - doForceLoop( pos, - rc, - A, - electroFrame, - frc, - trq, - tau.getArrayPointer(), - longRangePotential, - &passedCalcPot, - &passedCalcStress, - &isError ); - + doForceLoop(pos, + rc, + A, + electroFrame, + frc, + trq, + tau.getArrayPointer(), + longRangePotential, + particlePot, + &passedCalcPot, + &passedCalcStress, + &isError ); + if( isError ){ sprintf( painCave.errMsg, "Error returned from the fortran force calculation.\n" );