| 40 |
|
* [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). |
| 41 |
|
*/ |
| 42 |
|
|
| 43 |
+ |
#include "config.h" |
| 44 |
+ |
#include <cmath> |
| 45 |
|
#include "primitives/Bend.hpp" |
| 46 |
|
|
| 47 |
|
namespace OpenMD { |
| 48 |
|
|
| 49 |
|
/**@todo still a lot left to improve*/ |
| 50 |
< |
void Bend::calcForce(RealType& angle) { |
| 50 |
> |
void Bend::calcForce(RealType& angle, bool doParticlePot) { |
| 51 |
|
Vector3d pos1 = atom1_->getPos(); |
| 52 |
|
Vector3d pos2 = atom2_->getPos(); |
| 53 |
|
Vector3d pos3 = atom3_->getPos(); |
| 97 |
|
atom2_->addFrc(force2); |
| 98 |
|
atom3_->addFrc(force3); |
| 99 |
|
|
| 100 |
< |
atom1_->addParticlePot(potential_); |
| 101 |
< |
atom2_->addParticlePot(potential_); |
| 102 |
< |
atom3_->addParticlePot(potential_); |
| 100 |
> |
if (doParticlePot) { |
| 101 |
> |
atom1_->addParticlePot(potential_); |
| 102 |
> |
atom2_->addParticlePot(potential_); |
| 103 |
> |
atom3_->addParticlePot(potential_); |
| 104 |
> |
} |
| 105 |
|
|
| 106 |
|
angle = theta /M_PI * 180.0; |
| 107 |
|
} |