quadraticImproperTorsion.h

Go to the documentation of this file.
00001 // -*- Mode: C++; tab-width: 2; -*-
00002 // vi: set ts=2:
00003 //
00004 // $Id: quadraticImproperTorsion.h,v 1.15 2005/12/23 17:01:55 amoll Exp $
00005 //
00006 
00007 // Molecular Mechanics Parameter: class describing the parameters required to
00008 // describe a harmonic improper torsion (out-of-plane) potential
00009  
00010 #ifndef BALL_MOLMEC_PARAMETER_QUADRATICIMPROPERTORSION_H
00011 #define BALL_MOLMEC_PARAMETER_QUADRATICIMPROPERTORSION_H
00012 
00013 #ifndef BALL_FORMAT_PARAMETERSECTION_H
00014 # include <BALL/FORMAT/parameterSection.h>
00015 #endif
00016 
00017 #ifndef BALL_MOLMEC_PARAMETER_ATOMTYPES_H
00018 # include <BALL/MOLMEC/PARAMETER/atomTypes.h>
00019 #endif
00020 
00021 namespace BALL 
00022 {
00029   class BALL_EXPORT QuadraticImproperTorsion 
00030     : public ParameterSection
00031   {
00032     public:
00033 
00034     enum 
00035     {
00036       UNKNOWN
00037     };
00038 
00039     struct BALL_EXPORT Values
00040     {
00041       float phase;
00042       float k;
00043 
00044       bool operator == (const Values& values) const 
00045       {
00046         return ((phase == values.phase) && (k == values.k));
00047       }
00048 
00049       bool operator != (const Values& values) const 
00050       {
00051         return !(operator == (values));
00052       }
00053 
00054     };
00055 
00056     struct Data
00057     {
00058       Atom*   atom1;
00059       Atom*   atom2;
00060       Atom*   atom3;
00061       Atom*   atom4;
00062 
00063       Values  values;
00064     };
00065 
00066     BALL_CREATE(QuadraticImproperTorsion)
00067 
00068     
00071 
00074     QuadraticImproperTorsion() ;
00075 
00078     QuadraticImproperTorsion(const QuadraticImproperTorsion& torsion)
00079       ;
00080 
00083     virtual ~QuadraticImproperTorsion() ;
00084 
00087     virtual void clear() ;
00088 
00090 
00093 
00100     virtual bool extractSection(ForceFieldParameters& parameters,
00101         const String& section_name) ;
00102 
00104     virtual bool extractSection(Parameters& parameters,
00105         const String& section_name) ;
00106 
00108 
00111     bool hasParameters(Atom::Type I, Atom::Type J, Atom::Type K, Atom::Type L) 
00112       const ;
00113     
00116     QuadraticImproperTorsion::Values getParameters(Atom::Type I, Atom::Type J,
00117         Atom::Type K, Atom::Type L) const ;
00118     
00123     bool assignParameters(QuadraticImproperTorsion::Values& parameters,
00124         Atom::Type I, Atom::Type J, Atom::Type K, Atom::Type L) const
00125       ;
00126 
00130 
00133     const QuadraticImproperTorsion& operator = 
00134       (const QuadraticImproperTorsion& torsion) ;
00135 
00137 
00140 
00143     bool operator == (const QuadraticImproperTorsion& torsion) const
00144       ;
00145 
00147 
00148     protected:
00149 
00150     Size                  number_of_atom_types_;
00151 
00152     vector<Values>        torsions_;
00153     
00154     HashMap<Size, Size>   torsion_hash_map_;
00155   };
00157 } // namespace BALL
00158 
00159 #endif // BALL_MOLMEC_PARAMETER_QUADRATICIMPROPERTORSION_H