charmmNonBonded.h

Go to the documentation of this file.
00001 // -*- Mode: C++; tab-width: 2; -*-
00002 // vi: set ts=2:
00003 //
00004 // $Id: charmmNonBonded.h,v 1.23.18.1 2007/03/25 21:23:48 oliver Exp $
00005 //
00006 // Molecular Mechanics: Charmm force field, non-bonded component
00007 // (van der Waals, electrostatics, EEF1 solvation)
00008 //
00009 
00010 #ifndef BALL_MOLMEC_CHARMM_NONBONDED_H
00011 #define BALL_MOLMEC_CHARMM_NONBONDED_H
00012 
00013 #ifndef BALL_COMMON_H
00014 # include <BALL/common.h>
00015 #endif
00016 
00017 #ifndef BALL_MOLMEC_PARAMETER_LENNARDJONES_H
00018 # include <BALL/MOLMEC/PARAMETER/lennardJones.h>
00019 #endif
00020 
00021 #ifndef BALL_MOLMEC_PARAMETER_POTENTIAL1210_H
00022 # include <BALL/MOLMEC/PARAMETER/potential1210.h>
00023 #endif
00024 
00025 #ifndef BALL_MOLMEC_PARAMETER_CHARMMEEF1_H
00026 # include <BALL/MOLMEC/PARAMETER/charmmEEF1.h>
00027 #endif
00028 
00029 #ifndef BALL_MOLMEC_COMMON_FORCEFIELDCOMPONENT_H
00030 # include <BALL/MOLMEC/COMMON/forceFieldComponent.h>
00031 #endif
00032 
00033 #ifndef BALL_MOLMEC_COMMON_SUPPORT_H
00034 # include <BALL/MOLMEC/COMMON/support.h>
00035 #endif
00036 
00037 namespace BALL 
00038 {
00046   class BALL_EXPORT CharmmNonBonded 
00047     : public ForceFieldComponent
00048   {
00049     public:
00050 
00052     #define CHARMM_NB_ENABLED "enable NB"
00053 
00057 
00058     BALL_CREATE(CharmmNonBonded)
00059 
00060     
00062     CharmmNonBonded()
00063       ;
00064 
00067     CharmmNonBonded(ForceField& force_field)
00068       ;
00069 
00072     CharmmNonBonded(const CharmmNonBonded& charmm_non_bonded)
00073       ;
00074 
00077     virtual ~CharmmNonBonded()
00078       ;
00079 
00081 
00084     
00087     const CharmmNonBonded& operator = 
00088       (const CharmmNonBonded& charmm_non_bonded)
00089       ;
00090 
00093     virtual void clear()
00094       ;
00095 
00097 
00100 
00103     bool operator == (const CharmmNonBonded& charmm_non_bonded)
00104       ;
00105 
00107 
00110 
00113     virtual bool setup()
00114       throw(Exception::TooManyErrors);
00115 
00117 
00120 
00123     virtual double updateEnergy()
00124       ;
00125 
00128     virtual void updateForces()
00129       ;
00130 
00133     virtual double getElectrostaticEnergy() const
00134       ;
00135 
00138     virtual double getVdwEnergy() const
00139       ;
00140 
00143     virtual double getSolvationEnergy() const
00144       ;
00145 
00147 
00150 
00153     virtual MolmecSupport::PairListAlgorithmType  
00154       determineMethodOfAtomPairGeneration()
00155       ;
00156 
00159     virtual void buildVectorOfNonBondedAtomPairs
00160       (const std::vector<std::pair<Atom*, Atom*> >& atom_vector)
00161       throw(Exception::TooManyErrors);
00162 
00164 
00165     protected:
00166 
00167     /*_ @name Protected Attributes  
00168     */
00169     //_@{
00170 
00171     /*_ Value of the electrostatic energy
00172     */
00173     double  electrostatic_energy_;
00174 
00175     /*_ Value of the vdw energy
00176     */
00177     double  vdw_energy_;
00178 
00179     /*_ Value of the solvation energy
00180     */
00181     double solvation_energy_;
00182 
00183     //_@}
00184     /*_ @name Private Attributes  
00185     */
00186     //_@{
00187 
00188     private:
00189 
00190     /*_ Vector array with all atom pairs whose distance is smaller than cut_off
00191     */
00192     vector<LennardJones::Data>  non_bonded_;
00193     
00194     /*_ A helper array for buildVectorOfNonBondedAtomPairs(). This is
00195         declared here to save the ctor within the method.
00196     */
00197     vector<bool> is_torsion_;
00198 
00199     /*_ Number of 1-4 interactions in the vector non_bonded
00200     */
00201     Size  number_of_1_4_; 
00202 
00203     /*_ Cutoff distance for non-bonded interactions
00204     */
00205     float cut_off_;
00206 
00207     /*_ Cutoff distance for vdw interactions
00208     */
00209     float cut_off_vdw_;
00210 
00211     /*_ Start of the switch function for the vdw interactions
00212     */
00213     float cut_on_vdw_;
00214 
00215     /*_ Cutoff distance for electrostatic interactions
00216     */
00217     float cut_off_electrostatic_;
00218 
00219     /*_ Start of the switch function for the vdw interactions
00220     */
00221     float cut_on_electrostatic_;
00222 
00223     /*_ Cutoff distance for solvation contribution (EEF1)
00224     */
00225     float cut_off_solvation_;
00226 
00227     /*_ Start of the switch function for the solvation contribution (EEF1)
00228     */
00229     float cut_on_solvation_;
00230 
00231     /*_ Inverse cube of the difference of cutoff and cuton for vdW
00232     */
00233     float inverse_difference_off_on_vdw_3_;
00234 
00235     /*_ Inverse cube of the difference of cutoff and cuton for solvation
00236     */
00237     float inverse_difference_off_on_solvation_3_;
00238 
00239     /*_ Inverse cube of the difference of cutoff and cuton for electrostatic
00240     */
00241     float inverse_difference_off_on_electrostatic_3_;
00242 
00243     /*_ Scaling factor for vdw_1_4_interactions
00244     */
00245     float scaling_vdw_1_4_;
00246 
00247     /*_ Scaling factor for electrostatic_1_4_interactions
00248     */
00249     float scaling_electrostatic_1_4_;
00250 
00251     /*_ Flag for using constant or distance dependent dielectric constant 
00252         True = distance dependent
00253     */
00254     bool    use_dist_depend_dielectric_; 
00255 
00256     /*_ The most efficient algorithm to calculate the non-bonded atom pairs.
00257         {\tt BRUTE\_FORCE}: brute force: all against all\\
00258         {\tt HASH\_GRID}: box grid
00259     */
00260     MolmecSupport::PairListAlgorithmType  algorithm_type_;
00261     
00262     LennardJones                van_der_waals_parameters_;
00263 
00264     LennardJones                van_der_waals_parameters_14_;
00265 
00266     CharmmEEF1                  solvation_parameters_;
00267 
00268     vector<CharmmEEF1::Values>  solvation_;
00269 
00270     bool use_solvation_component_;
00271 
00272     //_@}
00273 
00274   };
00275 } // namespace BALL
00276 
00277 #endif // BALL_MOLMEC_CHARMM_CHARMMVDW_H