amberNonBonded.h

Go to the documentation of this file.
00001 // -*- Mode: C++; tab-width: 2; -*-
00002 // vi: set ts=2:
00003 //
00004 // $Id: amberNonBonded.h,v 1.30.18.1 2007/03/25 21:23:47 oliver Exp $
00005 //
00006 
00007 // Molecular Mechanics: Amber force field, non-bonded component
00008 
00009 #ifndef BALL_MOLMEC_AMBER_NONBONDED_H
00010 #define BALL_MOLMEC_AMBER_NONBONDED_H
00011 
00012 #ifndef BALL_COMMON_H
00013 # include <BALL/common.h>
00014 #endif
00015 
00016 #ifndef BALL_MOLMEC_PARAMETER_LENNARDJONES_H
00017 # include <BALL/MOLMEC/PARAMETER/lennardJones.h>
00018 #endif
00019 
00020 #ifndef BALL_MOLMEC_PARAMETER_POTENTIAL1210_H
00021 # include <BALL/MOLMEC/PARAMETER/potential1210.h>
00022 #endif
00023 
00024 #ifndef BALL_MOLMEC_COMMON_FORCEFIELDCOMPONENT_H
00025 # include <BALL/MOLMEC/COMMON/forceFieldComponent.h>
00026 #endif
00027 
00028 #ifndef BALL_MOLMEC_COMMON_SUPPORT_H
00029 # include <BALL/MOLMEC/COMMON/support.h>
00030 #endif
00031 
00032 namespace BALL 
00033 {
00038   class BALL_EXPORT AmberNonBonded 
00039     : public ForceFieldComponent
00040   {
00041     public:
00042 
00044     #define AMBER_NB_ENABLED "enable NB"
00045 
00049 
00050     BALL_CREATE(AmberNonBonded)
00051 
00052     
00054     AmberNonBonded()
00055       ;
00056 
00059     AmberNonBonded(ForceField& force_field)
00060       ;
00061 
00064     AmberNonBonded(const AmberNonBonded& amber_non_bonded)
00065       ;
00066 
00069     virtual ~AmberNonBonded()
00070       ;
00072 
00076     
00079     const AmberNonBonded& operator = (const AmberNonBonded& anb)
00080       ;
00081 
00084     virtual void clear()
00085       ;
00086 
00088 
00091       
00094     bool operator == (const AmberNonBonded& anb)
00095       ;
00096 
00098 
00101 
00104     virtual bool setup()
00105       throw(Exception::TooManyErrors);
00106 
00108 
00111 
00114     virtual double updateEnergy()
00115       ;
00116 
00119     virtual void updateForces()
00120       ;
00121 
00127     virtual void update()
00128       throw(Exception::TooManyErrors);
00129 
00132     virtual double getElectrostaticEnergy() const
00133       ;
00134 
00137     virtual double getVdwEnergy() const
00138       ;
00139 
00141 
00144 
00147     virtual MolmecSupport::PairListAlgorithmType
00148       determineMethodOfAtomPairGeneration()
00149       ;
00150 
00153     virtual void buildVectorOfNonBondedAtomPairs
00154       (const std::vector<std::pair<Atom*, Atom*> >& atom_vector,
00155        const LennardJones& lennard_jones,
00156        const Potential1210& hydrogen_bond)
00157       throw(Exception::TooManyErrors);
00158 
00160 
00161     protected:
00162 
00163     /*_ @name Protected Attributes  
00164     */
00165     //_@{
00166 
00167     /*_ Value of the electrostatic energy
00168     */
00169     double  electrostatic_energy_;
00170 
00171     /*_ Value of the vdw energy
00172     */
00173     double  vdw_energy_;
00174 
00175     //_@}
00176 
00177     private:
00178 
00179     /*_ @name Private Attributes  
00180     */
00181     //_@{
00182 
00183     /*_ Vector array with all atom pairs whose distance is smaller than cut_off
00184     */
00185     vector<LennardJones::Data>  non_bonded_;
00186 
00187     /*_ Vector of flags deciding whether the pair forms a hydrogen bond or a
00188         standard VdW interaction.
00189     */
00190     vector<char> is_hydrogen_bond_;
00191  
00192     /*_ Number of 1-4 interactions in the vector non_bonded
00193     */
00194     Size  number_of_1_4_; 
00195 
00196     /*_ Number of hydrogen bond interactions in the vector non_bonded
00197     */
00198     Size  number_of_h_bonds_; 
00199 
00200     /*_ Cutoff distance for non-bonded interactions
00201     */
00202     double  cut_off_;
00203 
00204     /*_ Cutoff distance for vdw interactions
00205     */
00206     double  cut_off_vdw_;
00207 
00208     /*_ Cuton distance for vdw interactions
00209     */
00210     double  cut_on_vdw_;
00211 
00212     /*_ Cutoff distance for electrostatic interactions
00213     */
00214     double  cut_off_electrostatic_;
00215 
00216     /*_ Cuton distance for electrostatic interactions
00217     */
00218     double  cut_on_electrostatic_;
00219 
00220     /*_ Inverse cube of the difference of squares of cuton and cutoff for vdW.
00221         This value is required for the switching function
00222     */
00223     double inverse_distance_off_on_vdw_3_;
00224     
00225     /*_ Inverse cube of the difference of squares of cuton and cutoff for eletrostatic.
00226         This value is required for the switching function
00227     */
00228     double inverse_distance_off_on_electrostatic_3_;
00229     
00230     /*_ Scaling factor for vdw_1_4_interactions
00231     */
00232     double  scaling_vdw_1_4_;
00233 
00234     /*_ Scaling factor for electrostatic_1_4_interactions
00235     */
00236     double  scaling_electrostatic_1_4_;
00237 
00238     /*_ Flag for using constant or distance dependent dielectric constant.
00239         True = distance dependent
00240     */
00241     bool    use_dist_depend_dielectric_; 
00242 
00243     /*_ The most efficient algorithm to calculate the non-bonded atom pairs.
00244         {\tt BRUTE\_FORCE}: brute force: all against all\\
00245         {\tt HASH\_GRID}: box grid
00246     */
00247     MolmecSupport::PairListAlgorithmType  algorithm_type_;
00248     
00249     LennardJones  van_der_waals_;
00250 
00251     Potential1210 hydrogen_bond_;
00252 
00253     //_@}
00254 
00255   };
00256 } // namespace BALL
00257 
00258 #endif // BALL_MOLMEC_AMBER_AMBERVDW_H