Debian Codegraph @

include/BALL/MOLMEC/AMBER/amberNonBonded.h

raw symbols SCIP
1 // -*- Mode: C++; tab-width: 2; -*-
2 // vi: set ts=2:
3 //
4
5 // Molecular Mechanics: Amber force field, non-bonded component
6
7 #ifndef BALL_MOLMEC_AMBER_NONBONDED_H
8 #define BALL_MOLMEC_AMBER_NONBONDED_H
9
10 #ifndef BALL_COMMON_H
11 # include <BALL/common.h>
12 #endif
13
14 #ifndef BALL_MOLMEC_PARAMETER_LENNARDJONES_H
15 # include <BALL/MOLMEC/PARAMETER/lennardJones.h>
16 #endif
17
18 #ifndef BALL_MOLMEC_PARAMETER_POTENTIAL1210_H
19 # include <BALL/MOLMEC/PARAMETER/potential1210.h>
20 #endif
21
22 #ifndef BALL_MOLMEC_COMMON_FORCEFIELDCOMPONENT_H
23 # include <BALL/MOLMEC/COMMON/forceFieldComponent.h>
24 #endif
25
26 #ifndef BALL_MOLMEC_COMMON_SUPPORT_H
27 # include <BALL/MOLMEC/COMMON/support.h>
28 #endif
29
30 namespace BALL
31 {
32 class AdvancedElectrostatic;
33
34 /** Amber NonBonded (VdW + Electrostatic) component
35
36 \ingroup AMBER
37 */
38 class BALL_EXPORT AmberNonBonded
39 : public ForceFieldComponent
40 {
41 public:
42
43 /// flag to enable NB
44 #define AMBER_NB_ENABLED "enable NB"
45
46 // NA*e0*e0*1e7 / (4.0*PI*VACUUM_PERMITTIVITY)
47 static const double ELECTROSTATIC_FACTOR;
48
49 /** @name Constructors and Destructors
50 */
51 //@{
52
53 BALL_CREATE(AmberNonBonded)
54
55 /** Default constructor.
56 */
57 AmberNonBonded()
58 ;
59
60 /** Constructor.
61 */
62 AmberNonBonded(ForceField& force_field)
63 ;
64
65 /** Copy constructor
66 */
67 AmberNonBonded(const AmberNonBonded& amber_non_bonded)
68 ;
69
70 /** Destructor.
71 */
72 virtual ~AmberNonBonded()
73 ;
74 //@}
75
76 /** Assignment
77 */
78 //@{
79
80 /** Assignment operator
81 */
82 const AmberNonBonded& operator = (const AmberNonBonded& anb)
83 ;
84
85 /** Clear method
86 */
87 virtual void clear()
88 ;
89
90 //@}
91 /** Predicates
92 */
93 //@{
94
95 /** Equality operator
96 */
97 bool operator == (const AmberNonBonded& anb)
98 ;
99
100 //@}
101 /** @name Setup Methods
102 */
103 //@{
104
105 /** Setup method.
106 * @throws BALL::Exception::TooManyErrors
107 */
108 virtual bool setup();
109
110
111 /** Setup this component according to the given options and store the ForceFieldParameters in par */
112 bool setup(Options& options, ForceFieldParameters& par);
113
114
115 //@}
116 /** @name Accessors
117 */
118 //@{
119
120 /** Calculates and returns the component's energy.
121 */
122 virtual double updateEnergy()
123 ;
124
125 /** Calculates and returns the component's forces.
126 */
127 virtual void updateForces()
128 ;
129
130 /** Update the pair list.
131 This method is called by the force field whenever
132 \link ForceField::update ForceField::update \endlink is called. It is used
133 to recalculate the nonbonded pair list.
134 @throws BALL::Exception::TooManyErrors
135 */
136 virtual void update();
137
138
139 /** Update this component using the given atom-pairs only */
140 void update(const std::vector<std::pair<Atom*, Atom*> >& atom_vector);
141
142
143 /** Return the electrostatic energy.
144 */
145 virtual double getElectrostaticEnergy() const
146 ;
147
148 /** Return the Van-der-Waals energy.
149 */
150 virtual double getVdwEnergy() const
151 ;
152
153 //@}
154 /** @name Neighbourhood and Parameter calculations
155 */
156 //@{
157
158 /** Computes the most efficient way to calculate the non-bonded atom pairs
159 */
160 virtual MolmecSupport::PairListAlgorithmType
161 determineMethodOfAtomPairGeneration()
162 ;
163
164 /** Build a vector of non-bonded atom pairs with the vdw parameters
165 * @throws BALL::Exception::TooManyErrors
166 */
167 virtual void buildVectorOfNonBondedAtomPairs
168 (const std::vector<std::pair<Atom*, Atom*> >& atom_vector,
169 const LennardJones& lennard_jones,
170 const Potential1210& hydrogen_bond);
171
172 //@}
173
174 void enableStoreInteractions(bool b=true);
175
176 void setAdvancedElectrostatic(AdvancedElectrostatic* advES);
177
178 protected:
179
180 /*_ @name Protected Attributes
181 */
182 //_@{
183
184 /*_ Value of the electrostatic energy
185 */
186 double electrostatic_energy_;
187
188 /*_ Value of the vdw energy
189 */
190 double vdw_energy_;
191
192 //_@}
193
194 private:
195
196 /*_ @name Private Attributes
197 */
198 //_@{
199
200 /*_ Vector array with all atom pairs whose distance is smaller than cut_off
201 */
202 std::vector<LennardJones::Data> non_bonded_;
203
204 /*_ Vector of flags deciding whether the pair forms a hydrogen bond or a
205 standard VdW interaction.
206 */
207 std::vector<char> is_hydrogen_bond_;
208
209 /*_ Number of 1-4 interactions in the vector non_bonded
210 */
211 Size number_of_1_4_;
212
213 /*_ Number of hydrogen bond interactions in the vector non_bonded
214 */
215 Size number_of_h_bonds_;
216
217 /*_ Cutoff distance for non-bonded interactions
218 */
219 double cut_off_;
220
221 /*_ Cutoff distance for vdw interactions
222 */
223 double cut_off_vdw_;
224
225 /*_ Cuton distance for vdw interactions
226 */
227 double cut_on_vdw_;
228
229 /*_ Cutoff distance for electrostatic interactions
230 */
231 double cut_off_electrostatic_;
232
233 /*_ Cuton distance for electrostatic interactions
234 */
235 double cut_on_electrostatic_;
236
237 /*_ Inverse cube of the difference of squares of cuton and cutoff for vdW.
238 This value is required for the switching function
239 */
240 double inverse_distance_off_on_vdw_3_;
241
242 /*_ Inverse cube of the difference of squares of cuton and cutoff for eletrostatic.
243 This value is required for the switching function
244 */
245 double inverse_distance_off_on_electrostatic_3_;
246
247 /*_ Scaling factor for vdw_1_4_interactions
248 */
249 double scaling_vdw_1_4_;
250
251 /*_ Scaling factor for electrostatic_1_4_interactions
252 */
253 double scaling_electrostatic_1_4_;
254
255 /*_ Flag for using constant or distance dependent dielectric constant.
256 True = distance dependent
257 */
258 bool use_dist_depend_dielectric_;
259
260 /*_ The most efficient algorithm to calculate the non-bonded atom pairs.
261 {\tt BRUTE\_FORCE}: brute force: all against all\\
262 {\tt HASH\_GRID}: box grid
263 */
264 MolmecSupport::PairListAlgorithmType algorithm_type_;
265
266 LennardJones van_der_waals_;
267
268 Potential1210 hydrogen_bond_;
269
270 //_@}
271
272 };
273 } // namespace BALL
274
275 #endif // BALL_MOLMEC_AMBER_AMBERVDW_H