--- branches/development/src/primitives/Inversion.cpp 2011/11/22 20:38:56 1665 +++ branches/development/src/primitives/Inversion.cpp 2012/05/19 13:30:21 1712 @@ -49,7 +49,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 +110,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; }