Debian Codegraph @

include/BALL/MOLMEC/MMFF94/MMFF94.h

raw symbols SCIP
1 // -*- Mode: C++; tab-width: 2; -*-
2 // vi: set ts=2:
3 //
4 // $Id: MMFF94.h,v 1.1.8.3 2007/06/15 09:24:20 amoll Exp $
5 //
6
7 // Molecular Mechanics: MMFF94 force field class
8
9 #ifndef BALL_MOLMEC_MMFF94_MMFF94_H
10 #define BALL_MOLMEC_MMFF94_MMFF94_H
11
12 #ifndef BALL_COMMON_H
13 # include <BALL/common.h>
14 #endif
15
16 #ifndef BALL_MOLMEC_COMMON_FORCEFIELD_H
17 # include <BALL/MOLMEC/COMMON/forceField.h>
18 #endif
19
20 #ifndef BALL_KERNEL_SYSTEM_H
21 # include <BALL/KERNEL/system.h>
22 #endif
23
24 #ifndef BALL_MOLMEC_MMFF94_MMFF94PARAMETERS_H
25 # include <BALL/MOLMEC/MMFF94/MMFF94Parameters.h>
26 #endif
27
28 #ifndef BALL_MOLMEC_MMFF94_MMFF94PROCESSORS_H
29 # include <BALL/MOLMEC/MMFF94/MMFF94Processors.h>
30 #endif
31
32 #ifndef BALL_DATATYPE_HASHSET_H
33 # include <BALL/DATATYPE/hashSet.h>
34 #endif
35
36 #ifndef BALL_STRUCTURE_KEKULIZER_H
37 # include <BALL/STRUCTURE/kekulizer.h>
38 #endif
39
40 #include <vector>
41
42 namespace BALL
43 {
44 using std::vector;
45
46 /** MMFF94 force field class.
47 \ingroup MMFF94
48 */
49 class BALL_EXPORT MMFF94
50 : public ForceField
51 {
52 public:
53
54 /** @name Constant Definitions
55 */
56 //@{
57
58 /** Option names
59 */
60 struct BALL_EXPORT Option
61 {
62 /** The parameters folder
63 */
64 static const char* FOLDER;
65
66 /** automatically assign charges to the system (during setup)
67 */
68 static const char* ASSIGN_CHARGES;
69
70 /** automatically assign type names to the system (during setup)
71 */
72 static const char* ASSIGN_TYPENAMES;
73
74 /** automatically assign types to the system's atoms (during setup)
75 */
76 static const char* ASSIGN_TYPES;
77
78 /** during charge assignment, overwrite even non-zero charges
79 */
80 static const char* OVERWRITE_CHARGES;
81
82 /** during charge assignment, overwrite even non-empty type names
83 */
84 static const char* OVERWRITE_TYPENAMES;
85
86 /** Nonbonded cutoff. This value is used as cutoff radius in
87 calculations of nonbonded interactions. The unit of this option
88 is \f${\AA}\f$ (@see Default::NONBONDED_CUTOFF)
89 */
90 static const char* NONBONDED_CUTOFF;
91
92 /** Van der Waals cutoff
93 NOT YET IMPLEMENTED!
94 */
95 static const char* VDW_CUTOFF;
96
97 /** Van der Waals cuton
98 NOT YET IMPLEMENTED!
99 */
100 static const char* VDW_CUTON;
101
102 /** Electrostatic cutoff
103 */
104 static const char* ELECTROSTATIC_CUTOFF;
105
106 /** Electrostatic cuton
107 */
108 static const char* ELECTROSTATIC_CUTON;
109
110 ///
111 static const char* DISTANCE_DEPENDENT_DIELECTRIC;
112 };
113
114 /** Default values for MMFF94 options.
115 */
116 struct BALL_EXPORT Default
117 {
118 /** Default folder name for parameters (MMFF94)
119 */
120 static const char* FOLDER;
121
122 /** automatically assign charges to the system (during setup)
123 */
124 static const bool ASSIGN_CHARGES;
125
126 /** automatically assign type names to the system (during setup)
127 */
128 static const bool ASSIGN_TYPENAMES;
129
130 /** automatically assign types to the system's atoms (during setup)
131 */
132 static const bool ASSIGN_TYPES;
133
134 /** during charge assignment, overwrite even non-zero charges
135 */
136 static const bool OVERWRITE_CHARGES;
137
138 /** during charge assignment, overwrite even non-empty type names
139 */
140 static const bool OVERWRITE_TYPENAMES;
141
142 /** Default non bonded cutoff of 16.0 \f${\AA}\f$.
143 */
144 static const float NONBONDED_CUTOFF;
145
146 /** Default van der Waals cutoff of 15.0 \f${\AA}\f$.
147 */
148 static const float VDW_CUTOFF;
149
150 /** Default van der Waals cuton of 13.0 \f${\AA}\f$.
151 */
152 static const float VDW_CUTON;
153
154 /** Default electrostatic cutoff of 15.0 \f${\AA}\f$.
155 */
156 static const float ELECTROSTATIC_CUTOFF;
157
158 /** Default electrostatic cuton of 13.0 \f${\AA}\f$.
159 */
160 static const float ELECTROSTATIC_CUTON;
161
162 /// Default is false
163 static const bool DISTANCE_DEPENDENT_DIELECTRIC;
164 };
165
166 //@}
167 /** @name Constructors and Destructor
168 */
169 //@{
170
171 BALL_CREATE(MMFF94)
172
173 /** Default constructor.
174 */
175 MMFF94();
176
177 /** Constructor.
178 */
179 MMFF94(System& system);
180
181 /** Constructor.
182 */
183 MMFF94(System& system, const Options& options);
184
185 /** Copy constructor
186 */
187 MMFF94(const MMFF94& force_field);
188
189 /** Destructor.
190 */
191 virtual ~MMFF94();
192
193 //@}
194 /** @name Assignment
195 */
196 //@{
197
198 /** Assignment operator
199 */
200 const MMFF94& operator = (const MMFF94& force_field)
201 ;
202
203 /** Clear method
204 */
205 virtual void clear()
206 ;
207
208 //@}
209 /** @name Setup Methods
210 */
211 //@{
212
213 /** Force field specific setup
214 * @throws BALL::Exception::TooManyErrors
215 */
216 virtual bool specificSetup();
217
218 //@}
219 /** @name Accessors specific to the MMFF94 force field
220 */
221 //@{
222
223 /** Return the bond stretch contribution to the total energy
224 */
225 double getStretchEnergy() const;
226
227 /** Return the angle bend contribution to the total energy
228 */
229 double getBendEnergy() const;
230
231 ///
232 double getStretchBendEnergy() const;
233
234 /** Return the torsion contribution to the total energy.
235 This energy comprises proper and improper torsions.
236 */
237 double getTorsionEnergy() const;
238
239 /** Return the nonbonded contribution to the total energy.
240 This energy comprises Van der Waals energy, hydrogen bond energy, and elesctrostatic energy.
241 */
242 double getNonbondedEnergy() const;
243
244 /** Return the electrostatic contribution to the total energy.
245 */
246 double getESEnergy() const;
247
248 /** Return the Van der Waals and hydrogen bond contribution to the total energy.
249 */
250 double getVdWEnergy() const;
251
252 ///
253 double getPlaneEnergy() const;
254
255 /** Return true, if the parameters have already been initialized
256 */
257 bool hasInitializedParameters() const;
258
259 /** Return the recommended number of iterations between updates.
260 This method return 20 as a default value.
261 */
262 Size getUpdateFrequency() const;
263
264 /// Get the current results in String form
265 virtual String getResults() const
266 ;
267
268 ///
269 const vector<Bond*> getBonds() const { return bonds_;}
270
271 ///
272 const vector<HashSet<Atom*> >& getRings() const { return rings_;}
273
274 ///
275 const vector<HashSet<Atom*> >& getAromaticRings() const { return aromatic_rings_;}
276
277 ///
278 bool isInOneAromaticRing(const Bond& bond) const;
279
280 ///
281 bool assignMMFF94BondType(Bond& bond) const;
282
283 ///
284 const vector<MMFF94AtomType>& getAtomTypes() const { return atom_types_.getAtomTypes();}
285
286 ///
287 const MMFF94StretchParameters& getStretchParameters() const { return bond_parameters_;}
288
289 ///
290 const MMFF94AtomTypeEquivalences & getEquivalences() const { return equivalences_;}
291
292 ///
293 bool areInOneRing(vector<Atom*> v, Size ring_size = 0) const;
294
295 ///
296 bool areInOneAromaticRing(const vector<Atom*>& v, Size ring_size = 0) const;
297
298 /** Check wheter the atoms type is valid.
299 If not, add it to unassigned atoms.
300 */
301 bool checkAtomType(Atom& atom);
302
303 //@}
304
305 protected:
306
307 void insertComponents_();
308
309 void transformAromaticBonds_();
310 void collectBonds_();
311 void assignBondTypes_();
312 void collectRings_();
313
314 String folder_;
315 MMFF94AtomTypes atom_types_;
316 MMFF94StretchParameters bond_parameters_;
317 MMFF94AtomTypeEquivalences equivalences_;
318 MMFF94ESParameters es_parameters_;
319 vector<HashSet<Atom*> > rings_;
320 vector<HashSet<Atom*> > aromatic_rings_;
321 bool parameters_initialized_;
322 vector<Bond*> bonds_;
323 MMFF94AtomTyper atom_typer_;
324 MMFF94ChargeProcessor charge_processor_;
325 Kekuliser kekuliser_;
326 HashSet<Bond*> aromatic_bonds_;
327 };
328
329 } // namespace BALL
330
331 #endif // BALL_MOLMEC_MMFF94_H