52#ifndef PRIMITIVES_INVERSION_HPP
53#define PRIMITIVES_INVERSION_HPP
56#include "primitives/ShortRangeInteraction.hpp"
82 virtual void calcForce(RealType& angle,
bool doParticlePot);
90 Vector3d pos1 = atoms_[1]->getPos(snapshotNo);
91 Vector3d pos2 = atoms_[2]->getPos(snapshotNo);
92 Vector3d pos3 = atoms_[0]->getPos(snapshotNo);
93 Vector3d pos4 = atoms_[3]->getPos(snapshotNo);
96 snapshotMan_->getSnapshot(snapshotNo)->
wrapVector(r31);
98 snapshotMan_->getSnapshot(snapshotNo)->
wrapVector(r23);
100 snapshotMan_->getSnapshot(snapshotNo)->
wrapVector(r43);
110 RealType cos_phi =
dot(A, B);
111 if (cos_phi > 1.0) cos_phi = 1.0;
112 if (cos_phi < -1.0) cos_phi = -1.0;
113 return acos(cos_phi);
116 RealType getPotential() {
return potential_; }
118 Atom* getAtomA() {
return atoms_[0]; }
120 Atom* getAtomB() {
return atoms_[1]; }
122 Atom* getAtomC() {
return atoms_[2]; }
124 Atom* getAtomD() {
return atoms_[3]; }
126 InversionType* getInversionType() {
return inversionType_; }
127 virtual std::string
getName() {
return name_; }
129 virtual void setName(
const std::string& name) { name_ = name; }
135 InversionKey inversionKey_;
virtual std::string getName()
Returns the name of this ShortRangeInteraction.
RealType getValue(int snapshotNo)
Returns the value of this ShortRangeInteraction in specified snapshot.
virtual void setName(const std::string &name)
Sets the name of this inversion for selections.
void accept(BaseVisitor *v)
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.
void normalize()
Normalizes this vector in place.
This basic Periodic Table class was originally taken from the data.cpp file in OpenBabel.
Vector3< Real > cross(const Vector3< Real > &v1, const Vector3< Real > &v2)
Returns the cross product of two Vectors.
Real dot(const DynamicVector< Real > &v1, const DynamicVector< Real > &v2)
Returns the dot product of two DynamicVectors.