--- branches/development/src/primitives/GhostBend.cpp 2011/11/22 20:38:56 1665 +++ branches/development/src/primitives/GhostBend.cpp 2012/07/06 22:01:58 1767 @@ -40,12 +40,14 @@ * [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). */ +#include "config.h" +#include #include "primitives/GhostBend.hpp" #include "primitives/DirectionalAtom.hpp" namespace OpenMD { /**@todo still a lot left to improve*/ - void GhostBend::calcForce(RealType& angle) { + void GhostBend::calcForce(RealType& angle, bool doParticlePot) { DirectionalAtom* ghostAtom = static_cast(atom2_); Vector3d pos1 = atom1_->getPos(); @@ -95,10 +97,11 @@ namespace OpenMD { ghostAtom->addFrc(-force1); ghostAtom->addTrq( cross(r23, force3) ); + if(doParticlePot) { + atom1_->addParticlePot(potential_); + ghostAtom->addParticlePot(potential_); + } - atom1_->addParticlePot(potential_); - ghostAtom->addParticlePot(potential_); - angle = theta /M_PI * 180.0; }