| 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 { |
| 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 |
| 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 |
|
|