Nonbonded.h

Go to the documentation of this file.
00001 //
00002 //  Copyright (C) 2004-2006 Rational Discovery LLC
00003 //
00004 //   @@ All Rights Reserved @@
00005 //  This file is part of the RDKit.
00006 //  The contents are covered by the terms of the BSD license
00007 //  which is included in the file license.txt, found at the root
00008 //  of the RDKit source tree.
00009 //
00010 #ifndef __RD_NONBONDED_H__
00011 #define __RD_NONBONDED_H__
00012 #include <ForceField/Contrib.h>
00013 
00014 namespace ForceFields {
00015   namespace UFF {
00016     class AtomicParams;
00017 
00018     //! the van der Waals term for the Universal Force Field
00019     /*!
00020       <b>The Distance Threshold</b>
00021        For the sake of efficiency, each vdwContrib maintains a threshold
00022        distance.  When the distance between the two atoms exceeds this
00023        threshold, the vdwContrib makes no contribution to either the
00024        energy or the gradient.
00025 
00026        The threshold is set to a multiple of the vdW distance's preferred
00027        length. This multiplier can be supplied to the constructor.
00028        
00029      */
00030     class vdWContrib : public ForceFieldContrib {
00031     public:
00032       vdWContrib() : d_at1Idx(-1), d_at2Idx(-1) {};
00033 
00034       //! Constructor
00035       /*!
00036         \param owner       pointer to the owning ForceField
00037         \param idx1        index of end1 in the ForceField's positions
00038         \param idx2        index of end2 in the ForceField's positions
00039         \param at1Params   pointer to the parameters for end1
00040         \param at2Params   pointer to the parameters for end2
00041         \param threshMultiplier (optional) multiplier for the threshold
00042                calculation. See class documentation for details.
00043 
00044       */
00045       vdWContrib(ForceField *owner,unsigned int idx1,unsigned int idx2,
00046                  const AtomicParams *at1Params,
00047                  const AtomicParams *at2Params,
00048                  double threshMultiplier=2.0);
00049       double getEnergy(double *pos) const;
00050       void getGrad(double *pos,double *grad) const;
00051     
00052     private:
00053       int d_at1Idx,d_at2Idx;
00054       double d_xij;       //!< the preferred length of the contact
00055       double d_wellDepth; //!< the vdW well depth (strength of the interaction)
00056       double d_thresh;    //!< the distance threshold
00057 
00058     };
00059     namespace Utils {
00060       //! calculates and returns the UFF minimum position for a vdW contact
00061       /*!
00062 
00063         \param at1Params  pointer to the parameters for end1
00064         \param at2Params  pointer to the parameters for end2
00065 
00066         \return the position of the minimum
00067 
00068       */
00069       double calcNonbondedMinimum(const AtomicParams *at1Params,
00070                                   const AtomicParams *at2Params);
00071 
00072       //! calculates and returns the UFF well depth for a vdW contact
00073       /*!
00074 
00075         \param at1Params  pointer to the parameters for end1
00076         \param at2Params  pointer to the parameters for end2
00077 
00078         \return the depth of the well
00079 
00080       */
00081       double calcNonbondedDepth(const AtomicParams *at1Params,
00082                                 const AtomicParams *at2Params);
00083 
00084 
00085     }
00086 
00087   }
00088 }
00089 #endif