# | Line 36 | Line 36 | |
---|---|---|
36 | * [1] Meineke, et al., J. Comp. Chem. 26, 252-271 (2005). | |
37 | * [2] Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006). | |
38 | * [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008). | |
39 | < | * [4] Vardeman & Gezelter, in progress (2009). |
39 | > | * [4] Kuang & Gezelter, J. Chem. Phys. 133, 164101 (2010). |
40 | > | * [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). |
41 | */ | |
42 | ||
43 | + | #include "config.h" |
44 | + | #include <cmath> |
45 | + | |
46 | #include "primitives/Inversion.hpp" | |
47 | ||
48 | namespace OpenMD { | |
# | Line 48 | Line 52 | namespace OpenMD { | |
52 | atom1_(atom1), atom2_(atom2), atom3_(atom3), atom4_(atom4), | |
53 | inversionType_(it) { } | |
54 | ||
55 | < | void Inversion::calcForce(RealType& angle) { |
55 | > | void Inversion::calcForce(RealType& angle, bool doParticlePot) { |
56 | ||
57 | // In OpenMD's version of an inversion, the central atom | |
58 | // comes first. However, to get the planarity in a typical cosine | |
# | Line 109 | Line 113 | namespace OpenMD { | |
113 | atom4_->addFrc(-f2); | |
114 | atom3_->addFrc(-f3); | |
115 | ||
116 | < | atom1_->addParticlePot(potential_); |
117 | < | atom2_->addParticlePot(potential_); |
118 | < | atom3_->addParticlePot(potential_); |
119 | < | atom4_->addParticlePot(potential_); |
120 | < | |
116 | > | if (doParticlePot) { |
117 | > | atom1_->addParticlePot(potential_); |
118 | > | atom2_->addParticlePot(potential_); |
119 | > | atom3_->addParticlePot(potential_); |
120 | > | atom4_->addParticlePot(potential_); |
121 | > | } |
122 | > | |
123 | angle = acos(cos_phi) /M_PI * 180.0; | |
124 | } | |
125 |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |