BALL  1.4.1
amberTorsion.h
Go to the documentation of this file.
00001 // -*- Mode: C++; tab-width: 2; -*-
00002 // vi: set ts=2:
00003 //
00004 
00005 // Molecular Mechanics: Amber force field, bond stretch component
00006 
00007 #ifndef BALL_MOLMEC_AMBER_AMBERTORSION_H
00008 #define BALL_MOLMEC_AMBER_AMBERTORSION_H
00009 
00010 #ifndef BALL_COMMON_H
00011 # include <BALL/common.h>
00012 #endif
00013 
00014 #ifndef BALL_MOLMEC_PARAMETER_COSINETORSION_H
00015 # include <BALL/MOLMEC/PARAMETER/cosineTorsion.h>
00016 #endif
00017 
00018 #ifndef BALL_MOLMEC_COMMON_FORCEFIELDCOMPONENT_H
00019 # include <BALL/MOLMEC/COMMON/forceFieldComponent.h>
00020 #endif
00021 
00022 #ifndef BALL_MOLMEC_COMMON_FORCEFIELD_H
00023 # include <BALL/MOLMEC/COMMON/forceField.h>
00024 #endif
00025 
00026 namespace BALL 
00027 {
00031   class BALL_EXPORT AmberTorsion 
00032     : public ForceFieldComponent
00033   {
00034     public:
00035 
00037     #define AMBER_TORSIONS_ENABLED "enable Torsions"
00038 
00042 
00043     struct SingleAmberTorsion 
00044     {
00045       Atom* atom1;
00046       Atom* atom2;
00047       Atom* atom3;
00048       Atom* atom4;
00049 
00050       float         V;
00051       unsigned char f;
00052       float         phase;
00053 
00054       SingleAmberTorsion()
00055         : atom1(0),
00056           atom2(0),
00057           atom3(0),
00058           atom4(0),
00059           V(0),
00060           f(0),
00061           phase(0)
00062       {
00063       }
00064         
00065 
00066       SingleAmberTorsion(CosineTorsion::SingleData& t)
00067       {
00068         atom1 = t.atom1;
00069         atom2 = t.atom2;
00070         atom3 = t.atom3;
00071         atom4 = t.atom4;
00072 
00073         V = t.values.V / t.values.n;
00074         f = (unsigned char)t.values.f;
00075         phase = ((2.0 * BALL::Constants::PI)/360.0) * t.values.phase;
00076       }
00077     };
00078 
00080 
00084 
00085     BALL_CREATE(AmberTorsion)
00086 
00087     
00089     AmberTorsion();
00090 
00093     AmberTorsion(ForceField& force_field);
00094 
00097     AmberTorsion(const AmberTorsion& amber_stretch);
00098 
00101     virtual ~AmberTorsion();
00102 
00104 
00107 
00110     virtual bool setup()
00111       throw(Exception::TooManyErrors);
00112 
00114 
00117 
00120     virtual double updateEnergy();
00121 
00124     virtual void updateForces();
00125 
00127 
00128     private:
00129 
00130     /*_ @name Private Attributes  
00131     */
00132     //_@{
00133 
00134     /*_ array with the torsions
00135     */
00136     vector<SingleAmberTorsion>  torsion_;
00137 
00138     CosineTorsion     torsion_parameters_;
00139     
00140     CosineTorsion     improper_parameters_;
00141 
00142     ParameterSection  impropers_;
00143 
00144     //_@}
00145    
00146   };
00147 } // namespace BALL 
00148 
00149 #endif // BALL_MOLMEC_AMBER_AMBERTORSION_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines