RDCode: BondStretch.h Source File

- Main Page
- Namespaces
- Classes
- Files
- Directories

# BondStretch.h

Go to the documentation of this file.

    00001 //
    00002 //  Copyright (C) 2004-2006 Rational Discovery LLC
    00003 //
    00004 //   @@ All Rights Reserved  @@
    00005 //
    00006 #ifndef __RD_BONDSTRETCH_H__
    00007 #define __RD_BONDSTRETCH_H__
    00008 #include <ForceField/Contrib.h>
    00009
    00010 namespace ForceFields {
    00011   namespace UFF {
    00012     class AtomicParams;
    00013
    00014     //! The bond-stretch term for the Universal Force Field
    00015     class BondStretchContrib : public ForceFieldContrib {
    00016     public:
    00017       BondStretchContrib() : d_end1Idx(-1), d_end2Idx(-1) {};
    00018       //! Constructor
    00019       /*!
    00020         \param owner       pointer to the owning ForceField
    00021         \param idx1        index of end1 in the ForceField's positions
    00022         \param idx2        index of end2 in the ForceField's positions
    00023         \param bondOrder   order of the bond (as a double)
    00024         \param end1Params  pointer to the parameters for end1
    00025         \param end2Params  pointer to the parameters for end2
    00026
    00027       */
    00028       BondStretchContrib(ForceField *owner,unsigned int idx1,unsigned int idx2,
    00029                          double bondOrder,
    00030                          const AtomicParams *end1Params,
    00031                          const AtomicParams *end2Params);
    00032
    00033       double getEnergy(double *pos) const;
    00034
    00035       void getGrad(double *pos,double *grad) const;
    00036
    00037     private:
    00038       int d_end1Idx,d_end2Idx; //!< indices of end points
    00039       double d_restLen;        //!< rest length of the bond
    00040       double d_forceConstant;  //!< force constant of the bond
    00041
    00042     };
    00043
    00044     namespace Utils {
    00045       //! calculates and returns the UFF rest length for a bond
    00046       /*!
    00047
    00048         \param bondOrder the order of the bond (as a double)
    00049         \param end1Params  pointer to the parameters for end1
    00050         \param end2Params  pointer to the parameters for end2
    00051
    00052         \return the rest length
    00053
    00054       */
    00055       double calcBondRestLength(double bondOrder,
    00056                                 const AtomicParams *end1Params,
    00057                                 const AtomicParams *end2Params);
    00058
    00059       //! calculates and returns the UFF force constant for a bond
    00060       /*!
    00061
    00062         \param restLength  the rest length of the bond
    00063         \param end1Params  pointer to the parameters for end1
    00064         \param end2Params  pointer to the parameters for end2
    00065
    00066         \return the force constant
    00067
    00068       */
    00069       double calcBondForceConstant(double restLength,
    00070                                    const AtomicParams *end1Params,
    00071                                    const AtomicParams *end2Params);
    00072
    00073     }
    00074   }
    00075 }
    00076 #endif