--- branches/development/src/primitives/Inversion.cpp 2011/11/22 20:38:56 1665 +++ branches/development/src/primitives/Inversion.cpp 2012/07/06 22:01:58 1767 @@ -40,6 +40,9 @@ * [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). */ +#include "config.h" +#include + #include "primitives/Inversion.hpp" namespace OpenMD { @@ -49,7 +52,7 @@ namespace OpenMD { atom1_(atom1), atom2_(atom2), atom3_(atom3), atom4_(atom4), inversionType_(it) { } - void Inversion::calcForce(RealType& angle) { + void Inversion::calcForce(RealType& angle, bool doParticlePot) { // In OpenMD's version of an inversion, the central atom // comes first. However, to get the planarity in a typical cosine @@ -110,11 +113,13 @@ namespace OpenMD { atom4_->addFrc(-f2); atom3_->addFrc(-f3); - atom1_->addParticlePot(potential_); - atom2_->addParticlePot(potential_); - atom3_->addParticlePot(potential_); - atom4_->addParticlePot(potential_); - + if (doParticlePot) { + atom1_->addParticlePot(potential_); + atom2_->addParticlePot(potential_); + atom3_->addParticlePot(potential_); + atom4_->addParticlePot(potential_); + } + angle = acos(cos_phi) /M_PI * 180.0; }