TorsionAngle.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006 #ifndef __RD_TORSIONANGLE_H__
00007 #define __RD_TORSIONANGLE_H__
00008
00009 #include <ForceField/Contrib.h>
00010
00011
00012 #include <GraphMol/Atom.h>
00013
00014
00015 namespace RDGeom {
00016 class Point3D;
00017 }
00018
00019 namespace ForceFields {
00020 namespace UFF {
00021 class AtomicParams;
00022
00023
00024 class TorsionAngleContrib : public ForceFieldContrib {
00025 public:
00026 TorsionAngleContrib() : d_at1Idx(-1), d_at2Idx(-1), d_at3Idx(-1), d_at4Idx(-1), d_order(0) {};
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054 TorsionAngleContrib(ForceField *owner,
00055 unsigned int idx1,unsigned int idx2,
00056 unsigned int idx3,unsigned int idx4,
00057 double bondOrder23,
00058 int atNum2,int atNum3,
00059 RDKit::Atom::HybridizationType hyb2,
00060 RDKit::Atom::HybridizationType hyb3,
00061 const AtomicParams *at2Params,
00062 const AtomicParams *at3Params,
00063 bool endAtomIsSP2=false);
00064 double getEnergy(double *pos) const;
00065 void getGrad(double *pos,double *grad) const;
00066 void scaleForceConstant(unsigned int count) { this->d_forceConstant /= static_cast<double>(count); };
00067 private:
00068 int d_at1Idx,d_at2Idx,d_at3Idx,d_at4Idx;
00069 unsigned int d_order;
00070 double d_forceConstant,d_cosTerm;
00071
00072
00073 double getThetaDeriv(double cosTheta,double sinTheta) const;
00074
00075
00076
00077
00078
00079 void calcTorsionParams(double bondOrder23,
00080 int atNum2,int atNum3,
00081 RDKit::Atom::HybridizationType hyb2,
00082 RDKit::Atom::HybridizationType hyb3,
00083 const AtomicParams *at2Params,
00084 const AtomicParams *at3Params,
00085 bool endAtomIsSP2);
00086
00087 };
00088
00089 namespace Utils {
00090
00091 double calculateCosTorsion(const RDGeom::Point3D &p1,const RDGeom::Point3D &p2,
00092 const RDGeom::Point3D &p3,const RDGeom::Point3D &p4);
00093 }
00094 }
00095 }
00096 #endif