Debian Codegraph @

include/BALL/MOLMEC/MMFF94/MMFF94StretchBend.h

raw symbols SCIP
1 // -*- Mode: C++; tab-width: 2; -*-
2 // vi: set ts=2:
3 //
4 // $Id: MMFF94StretchBend.h,v 1.1.8.1 2007/03/25 21:25:18 oliver Exp $
5 //
6
7 #ifndef BALL_MOLMEC_MMFF94_MMFF94STRETCHBEND_H
8 #define BALL_MOLMEC_MMFF94_MMFF94STRETCHBEND_H
9
10 #ifndef BALL_MOLMEC_COMMON_FORCEFIELDCOMPONENT_H
11 # include <BALL/MOLMEC/COMMON/forceFieldComponent.h>
12 #endif
13
14 #ifndef BALL_MOLMEC_MMFF94_MMFF94PARAMETERS_H
15 # include <BALL/MOLMEC/MMFF94/MMFF94Parameters.h>
16 #endif
17
18 namespace BALL
19 {
20 class MMFF94;
21
22 /** MMFF94 bond stretch component
23 \ingroup MMFF94
24 */
25 class BALL_EXPORT MMFF94StretchBend
26 : public ForceFieldComponent
27 {
28 public:
29
30 struct BALL_EXPORT StretchBend
31 {
32 double kba_ijk;
33 double kba_kji;
34 double energy; // debug
35 Index sbtijk;
36 Index stretch_i_j, stretch_j_k;
37 Index bend_index;
38 };
39
40 /// see MMFFANG.PAR
41 struct BALL_EXPORT Bend
42 {
43 Bend();
44
45 double theta0;
46 double delta_theta;
47 double theta;
48 double ka;
49 Atom* atom1;
50 Atom* atom2;
51 Atom* atom3;
52 bool is_linear;
53 Position ATIJK;
54 double energy; // debug
55 bool emperical; // debug
56 TVector3<double> n1, n2;
57 };
58
59 ///
60 struct BALL_EXPORT Stretch
61 {
62 Stretch()
63 : atom1(NULL),
64 atom2(NULL),
65 kb(0.0),
66 r0(0.0),
67 delta_r(0.0),
68 sbmb(false),
69 emperical(false)
70 {
71 }
72
73 Atom* atom1;
74 Atom* atom2;
75 double kb;
76 double r0;
77 double delta_r;
78 bool sbmb;
79 bool emperical;
80 Vector3 n;
81 };
82
83 /// flag to enable BENDS
84 #define MMFF94_BENDS_ENABLED "enable Bends"
85
86 /// flag to enable Stretches
87 #define MMFF94_STRETCHES_ENABLED "enable Stretches"
88
89 /// flag to enable StretchBends
90 #define MMFF94_STRETCHBENDS_ENABLED "enable StrechBends"
91
92 BALL_CREATE(MMFF94StretchBend)
93
94 /** Default constructor.
95 */
96 MMFF94StretchBend();
97
98 /** Constructor.
99 */
100 MMFF94StretchBend(ForceField& force_field);
101
102 /** Copy constructor
103 */
104 MMFF94StretchBend(const MMFF94StretchBend& to_copy);
105
106 /** Destructor.
107 */
108 virtual ~MMFF94StretchBend();
109
110 /** Setup method.
111 * @throws BALL::Exception::TooManyErrors
112 */
113 virtual bool setup();
114
115 /// Calculates and returns the component's energy.
116 virtual double updateEnergy();
117
118 ///
119 virtual double updateBendEnergy();
120
121 ///
122 virtual double updateStretchEnergy();
123
124 ///
125 virtual double updateStretchBendEnergy();
126
127 ///
128 double getStretchEnergy() const;
129
130 ///
131 double getBendEnergy() const;
132
133 ///
134 double getStretchBendEnergy() const;
135
136 /// Calculates and returns the component's forces.
137 virtual void updateForces();
138
139 ///
140 virtual void updateBendForces();
141
142 ///
143 virtual void updateStretchForces();
144
145 ///
146 virtual void updateStretchBendForces();
147
148 ///
149 const vector<Bend>& getBends() const { return bends_;}
150
151 ///
152 const vector<Stretch>& getStretches() const { return stretches_;}
153
154 ///
155 const vector<StretchBend>& getStretchBends() const { return stretch_bends_;}
156
157 ///
158 Index calculateSBTIJK(Position angle_type,
159 bool bond_type1,
160 bool bond_type2);
161
162 ///
163 Position getBendType(const Bond& bond1, const Bond& bond2,
164 Atom& atom1, Atom& atom2, Atom& atom3) const;
165
166 /// Bend emperical reference angle
167 double calculateBendEmpiricalReferenceAngle(Atom& atom1, Atom& atom2, Atom& atom3) const;
168
169 /// Bend emperical force constant
170 double calculateBendEmpiricalForceConstant(Atom& atom1, Atom& atom2, Atom& atom3, double angle_0) const;
171
172 /// Calculate the radius value per Schomaker-Stevenson Rule
173 double calculateStretchR0(const Bond& bond);
174
175 ///
176 double calculateStretchConstant(const Bond& bond, double r0);
177
178 private:
179
180 inline void AddDV3_(Vector3& f3, const TVector3<double> d3);
181 void calculateDeltas_();
182 bool setupBends_();
183 bool setupStretches_();
184 bool setupStretchBends_();
185
186 void errorOccurred_(const String& string,
187 const Atom& a1, const Atom& a2, const Atom& a3);
188
189 vector<Bend> bends_;
190 vector<Stretch> stretches_;
191 vector<StretchBend> stretch_bends_;
192
193 const MMFF94StretchParameters* stretch_parameters_;
194 MMFF94BendParameters bend_parameters_;
195 MMFF94StretchBendParameters sb_parameters_;
196
197 static double bend_z_[];
198 static double bend_c_[];
199 static String bend_elements_[];
200
201 double stretch_energy_;
202 double bend_energy_;
203 double stretch_bend_energy_;
204
205 MMFF94* mmff94_;
206 bool stretch_enabled_, bend_enabled_, stretchbend_enabled_;
207 };
208 } // namespace BALL
209
210 #endif // BALL_MOLMEC_MMFF94_MMFF94STRETCHBEND_H