44#ifndef PRIMITIVES_STRETCHBEND_HPP
45#define PRIMITIVES_STRETCHBEND_HPP
47#include "primitives/ShortRangeInteraction.hpp"
76 virtual void calcForce(RealType& angle,
bool doParticlePot);
79 Vector3d pos1 = atoms_[0]->getPos(snapshotNo);
80 Vector3d pos2 = atoms_[1]->getPos(snapshotNo);
81 Vector3d pos3 = atoms_[2]->getPos(snapshotNo);
84 snapshotMan_->getSnapshot(snapshotNo)->
wrapVector(r21);
85 RealType d21 = r21.
length();
88 snapshotMan_->getSnapshot(snapshotNo)->
wrapVector(r23);
89 RealType d23 = r23.
length();
91 RealType cosTheta =
dot(r21, r23) / (d21 * d23);
96 }
else if (cosTheta < -1.0) {
100 return acos(cosTheta);
104 RealType getPotential() {
120 BendType * getBendType() {
124 virtual std::string
getName() {
return name_;}
126 virtual void setName(
const std::string& name) { name_ = name;}
virtual std::string getName()
Returns the name of this ShortRangeInteraction.
virtual void calcForce(RealType &angle, bool doParticlePot)
BendType * bendType_
bend type
RealType getValue(int snapshotNo)
Returns the value of this ShortRangeInteraction in specified snapshot.
void accept(BaseVisitor *v)
virtual void setName(const std::string &name)
Sets the name of this bend for selections.
A ShortRangeInteraction holds some bookeeping data for bonded interactions (e.g.
virtual RealType getValue()
Returns the current value of this ShortRangeInteraction.
virtual RealType getPrevValue()
Returns the previous value of this ShortRangeInteraction.
void wrapVector(Vector3d &v)
Wrapping the vector according to periodic boundary condition.
Real length()
Returns the length of this vector.
This basic Periodic Table class was originally taken from the data.cpp file in OpenBabel.
Real dot(const DynamicVector< Real > &v1, const DynamicVector< Real > &v2)
Returns the dot product of two DynamicVectors.