RDCode: AngleBend.h Source File

# AngleBend.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_ANGLEBEND_H__
    00007 #define __RD_ANGLEBEND_H__
    00008
    00009 #include <ForceField/Contrib.h>
    00010
    00011 namespace ForceFields {
    00012   namespace UFF {
    00013     class AtomicParams;
    00014
    00015
    00016     //! The angle-bend term for the Universal Force Field
    00017     class AngleBendContrib : public ForceFieldContrib {
    00018     public:
    00019       AngleBendContrib() : d_at1Idx(-1), d_at2Idx(-1), d_at3Idx(-1),d_order(0) {};
    00020       //! Constructor
    00021       /*!
    00022         The angle is between atom1 - atom2 - atom3
    00023
    00024         \param owner       pointer to the owning ForceField
    00025         \param idx1        index of atom1 in the ForceField's positions
    00026         \param idx2        index of atom2 in the ForceField's positions
    00027         \param idx3        index of atom3 in the ForceField's positions
    00028         \param bondOrder12 order of the bond between atoms 1 and 2 (as a double)
    00029         \param bondOrder23 order of the bond between atoms 2 and 3 (as a double)
    00030         \param at1Params   pointer to the parameters for atom 1
    00031         \param at2Params   pointer to the parameters for atom 2
    00032         \param at3Params   pointer to the parameters for atom 3
    00033         \param order (optional) the order of the angle term, this is for
    00034            special cases and should adopt values:
    00035              - 0: not a special case, use the \c theta0 value from \c at2Params
    00036              - 2: linear coordination
    00037              - 3: trigonal planar coordination
    00038              - 4: square planar or tetrahedral coordination
    00039
    00040       */
    00041       AngleBendContrib(ForceField *owner,
    00042                        unsigned int idx1,unsigned int idx2,unsigned int idx3,
    00043                        double bondOrder12,double bondOrder23,
    00044                        const AtomicParams *at1Params,
    00045                        const AtomicParams *at2Params,
    00046                        const AtomicParams *at3Params,
    00047                        unsigned int order=0);
    00048       double getEnergy(double *pos) const;
    00049       void getGrad(double *pos,double *grad) const;
    00050
    00051     private:
    00052       int d_at1Idx,d_at2Idx,d_at3Idx;
    00053       unsigned int d_order;
    00054       double d_forceConstant,d_theta0,d_C0,d_C1,d_C2;
    00055
    00056       double getEnergyTerm(double cosTheta,double sinThetaSq) const;
    00057       double getThetaDeriv(double cosTheta,double sinTheta) const;
    00058     };
    00059
    00060     namespace Utils {
    00061       //! Calculate the force constant for an angle bend
    00062       /*!
    00063         The angle is between atom1 - atom2 - atom3
    00064
    00065         \param theta0      the preferred value of the angle (in radians)
    00066         \param bondOrder12 order of the bond between atoms 1 and 2 (as a double)
    00067         \param bondOrder23 order of the bond between atoms 2 and 3 (as a double)
    00068         \param at1Params   pointer to the parameters for atom 1
    00069         \param at2Params   pointer to the parameters for atom 2
    00070         \param at3Params   pointer to the parameters for atom 3
    00071
    00072       */
    00073       double calcAngleForceConstant(double theta0,
    00074                                     double bondOrder12,double bondOrder23,
    00075                                     const AtomicParams *at1Params,
    00076                                     const AtomicParams *at2Params,
    00077                                     const AtomicParams *at3Params);
    00078     }
    00079   }
    00080 }
    00081 #endif