Debian Codegraph @

include/BALL/MOLMEC/PARAMETER/quadraticImproperTorsion.h

raw symbols SCIP
1 // -*- Mode: C++; tab-width: 2; -*-
2 // vi: set ts=2:
3 //
4
5 // Molecular Mechanics Parameter: class describing the parameters required to
6 // describe a harmonic improper torsion (out-of-plane) potential
7
8 #ifndef BALL_MOLMEC_PARAMETER_QUADRATICIMPROPERTORSION_H
9 #define BALL_MOLMEC_PARAMETER_QUADRATICIMPROPERTORSION_H
10
11 #ifndef BALL_FORMAT_PARAMETERSECTION_H
12 # include <BALL/FORMAT/parameterSection.h>
13 #endif
14
15 #ifndef BALL_MOLMEC_PARAMETER_ATOMTYPES_H
16 # include <BALL/MOLMEC/PARAMETER/atomTypes.h>
17 #endif
18
19 namespace BALL
20 {
21 /** \addtogroup MolmecParameters
22 * @{
23 */
24 /** QuadraticImproperTorsion.
25
26 */
27 class BALL_EXPORT QuadraticImproperTorsion
28 : public ParameterSection
29 {
30 public:
31
32 enum
33 {
34 UNKNOWN
35 };
36
37 struct BALL_EXPORT Values
38 {
39 float phase;
40 float k;
41
42 bool operator == (const Values& values) const
43 {
44 return ((phase == values.phase) && (k == values.k));
45 }
46
47 bool operator != (const Values& values) const
48 {
49 return !(operator == (values));
50 }
51
52 };
53
54 struct Data
55 {
56 Atom* atom1;
57 Atom* atom2;
58 Atom* atom3;
59 Atom* atom4;
60
61 Values values;
62 };
63
64 BALL_CREATE(QuadraticImproperTorsion)
65
66 /** @name Constructors and destructor
67 */
68 //@{
69
70 /** Default constructor.
71 */
72 QuadraticImproperTorsion() ;
73
74 /** Copy constructor.
75 */
76 QuadraticImproperTorsion(const QuadraticImproperTorsion& torsion)
77 ;
78
79 /** Destructor.
80 */
81 virtual ~QuadraticImproperTorsion() ;
82
83 /** Clear method.
84 */
85 virtual void clear() ;
86
87 //@}
88 /** @name Parameter extraction
89 */
90 //@{
91
92 /** Reads a parameter section from an INI file.
93 This method reads the section given in section\_name from ini\_file,
94 interprets (if given) a format line, reads the data from this
95 section according to the format, and builds some datastructures for
96 fast and easy acces this data.
97 */
98 virtual bool extractSection(ForceFieldParameters& parameters,
99 const String& section_name) ;
100
101 ///
102 virtual bool extractSection(Parameters& parameters,
103 const String& section_name) ;
104
105 //@}
106
107 /** Queries whether a parameter set is defined for the given atom types.
108 */
109 bool hasParameters(Atom::Type I, Atom::Type J, Atom::Type K, Atom::Type L)
110 const ;
111
112 /** Returns the parameters for a given atom type combination.
113 */
114 QuadraticImproperTorsion::Values getParameters(Atom::Type I, Atom::Type J,
115 Atom::Type K, Atom::Type L) const ;
116
117 /** Assign the parameters for a given atom type combination.
118 If no parameters are defined for this combination, false is
119 returned and nothing is changed.
120 */
121 bool assignParameters(QuadraticImproperTorsion::Values& parameters,
122 Atom::Type I, Atom::Type J, Atom::Type K, Atom::Type L) const
123 ;
124
125 /** @name Assignment
126 */
127 //@{
128
129 /** Assignment operator
130 */
131 const QuadraticImproperTorsion& operator =
132 (const QuadraticImproperTorsion& torsion) ;
133
134 //@}
135 /** @name Predicates
136 */
137 //@{
138
139 /** Equality operator
140 */
141 bool operator == (const QuadraticImproperTorsion& torsion) const
142 ;
143
144 //@}
145
146 protected:
147
148 Size number_of_atom_types_;
149
150 vector<Values> torsions_;
151
152 HashMap<Size, Size> torsion_hash_map_;
153 };
154 /** @} */
155 } // namespace BALL
156
157 #endif // BALL_MOLMEC_PARAMETER_QUADRATICIMPROPERTORSION_H