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