Debian Codegraph @

include/BALL/MOLMEC/CHARMM/charmmNonBonded.h

raw symbols SCIP
1 // -*- Mode: C++; tab-width: 2; -*-
2 // vi: set ts=2:
3 //
4
5 // Molecular Mechanics: Charmm force field, non-bonded component
6 // (van der Waals, electrostatics, EEF1 solvation)
7 //
8
9 #ifndef BALL_MOLMEC_CHARMM_NONBONDED_H
10 #define BALL_MOLMEC_CHARMM_NONBONDED_H
11
12 #ifndef BALL_COMMON_H
13 # include <BALL/common.h>
14 #endif
15
16 #ifndef BALL_MOLMEC_PARAMETER_LENNARDJONES_H
17 # include <BALL/MOLMEC/PARAMETER/lennardJones.h>
18 #endif
19
20 #ifndef BALL_MOLMEC_PARAMETER_POTENTIAL1210_H
21 # include <BALL/MOLMEC/PARAMETER/potential1210.h>
22 #endif
23
24 #ifndef BALL_MOLMEC_PARAMETER_CHARMMEEF1_H
25 # include <BALL/MOLMEC/PARAMETER/charmmEEF1.h>
26 #endif
27
28 #ifndef BALL_MOLMEC_COMMON_FORCEFIELDCOMPONENT_H
29 # include <BALL/MOLMEC/COMMON/forceFieldComponent.h>
30 #endif
31
32 #ifndef BALL_MOLMEC_COMMON_SUPPORT_H
33 # include <BALL/MOLMEC/COMMON/support.h>
34 #endif
35
36 namespace BALL
37 {
38 /** Charmm NonBonded component.
39 This force field component implements the non-bonded interactions
40 in the CHARMM force field: van-der-Waals interaction, electrostatics,
41 and solvation (in EEF1 only).
42
43 \ingroup CHARMM
44 */
45 class BALL_EXPORT CharmmNonBonded
46 : public ForceFieldComponent
47 {
48 public:
49
50 /// flag to enable NonBonded
51 #define CHARMM_NB_ENABLED "enable NB"
52
53 /** @name Constructors and Destructors
54 */
55 //@{
56
57 BALL_CREATE(CharmmNonBonded)
58
59 /** Default constructor.
60 */
61 CharmmNonBonded()
62 ;
63
64 /** Constructor.
65 */
66 CharmmNonBonded(ForceField& force_field)
67 ;
68
69 /** Copy constructor
70 */
71 CharmmNonBonded(const CharmmNonBonded& charmm_non_bonded)
72 ;
73
74 /** Destructor.
75 */
76 virtual ~CharmmNonBonded()
77 ;
78
79 //@}
80 /** @name Assignment
81 */
82 //@{
83
84 /** Assignment operator
85 */
86 const CharmmNonBonded& operator =
87 (const CharmmNonBonded& charmm_non_bonded)
88 ;
89
90 /** Clear method
91 */
92 virtual void clear()
93 ;
94
95 //@}
96 /** @name Predicates
97 */
98 //@{
99
100 /** Equality operator
101 */
102 bool operator == (const CharmmNonBonded& charmm_non_bonded)
103 ;
104
105 //@}
106 /** @name Setup Methods
107 */
108 //@{
109
110 /** Setup method.
111 * @throws BALL::Exception::TooManyErrors
112 */
113 virtual bool setup();
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 /** Return the electrostatic energy.
131 */
132 virtual double getElectrostaticEnergy() const
133 ;
134
135 /** Return the Van-der-Waals energy.
136 */
137 virtual double getVdwEnergy() const
138 ;
139
140 /** Return the solvation energy.
141 */
142 virtual double getSolvationEnergy() const
143 ;
144
145 //@}
146 /** @name Neighbourhood and Parameter calculations
147 */
148 //@{
149
150 /** Computes the most efficient way to calculate the non-bonded atom pairs
151 */
152 virtual MolmecSupport::PairListAlgorithmType
153 determineMethodOfAtomPairGeneration()
154 ;
155
156 /** Build a vector of non-bonded atom pairs with the vdw parameters
157 * @throws BALL::Exception::TooManyErrors
158 */
159 virtual void buildVectorOfNonBondedAtomPairs
160 (const std::vector<std::pair<Atom*, Atom*> >& atom_vector);
161
162 //@}
163
164 protected:
165
166 /*_ @name Protected Attributes
167 */
168 //_@{
169
170 /*_ Value of the electrostatic energy
171 */
172 double electrostatic_energy_;
173
174 /*_ Value of the vdw energy
175 */
176 double vdw_energy_;
177
178 /*_ Value of the solvation energy
179 */
180 double solvation_energy_;
181
182 //_@}
183 /*_ @name Private Attributes
184 */
185 //_@{
186
187 private:
188
189 /*_ Vector array with all atom pairs whose distance is smaller than cut_off
190 */
191 vector<LennardJones::Data> non_bonded_;
192
193 /*_ A helper array for buildVectorOfNonBondedAtomPairs(). This is
194 declared here to save the ctor within the method.
195 */
196 vector<bool> is_torsion_;
197
198 /*_ Number of 1-4 interactions in the vector non_bonded
199 */
200 Size number_of_1_4_;
201
202 /*_ Cutoff distance for non-bonded interactions
203 */
204 float cut_off_;
205
206 /*_ Cutoff distance for vdw interactions
207 */
208 float cut_off_vdw_;
209
210 /*_ Start of the switch function for the vdw interactions
211 */
212 float cut_on_vdw_;
213
214 /*_ Cutoff distance for electrostatic interactions
215 */
216 float cut_off_electrostatic_;
217
218 /*_ Start of the switch function for the vdw interactions
219 */
220 float cut_on_electrostatic_;
221
222 /*_ Cutoff distance for solvation contribution (EEF1)
223 */
224 float cut_off_solvation_;
225
226 /*_ Start of the switch function for the solvation contribution (EEF1)
227 */
228 float cut_on_solvation_;
229
230 /*_ Inverse cube of the difference of cutoff and cuton for vdW
231 */
232 float inverse_difference_off_on_vdw_3_;
233
234 /*_ Inverse cube of the difference of cutoff and cuton for solvation
235 */
236 float inverse_difference_off_on_solvation_3_;
237
238 /*_ Inverse cube of the difference of cutoff and cuton for electrostatic
239 */
240 float inverse_difference_off_on_electrostatic_3_;
241
242 /*_ Scaling factor for vdw_1_4_interactions
243 */
244 float scaling_vdw_1_4_;
245
246 /*_ Scaling factor for electrostatic_1_4_interactions
247 */
248 float scaling_electrostatic_1_4_;
249
250 /*_ Flag for using constant or distance dependent dielectric constant
251 True = distance dependent
252 */
253 bool use_dist_depend_dielectric_;
254
255 /*_ The most efficient algorithm to calculate the non-bonded atom pairs.
256 {\tt BRUTE\_FORCE}: brute force: all against all\\
257 {\tt HASH\_GRID}: box grid
258 */
259 MolmecSupport::PairListAlgorithmType algorithm_type_;
260
261 LennardJones van_der_waals_parameters_;
262
263 LennardJones van_der_waals_parameters_14_;
264
265 CharmmEEF1 solvation_parameters_;
266
267 vector<CharmmEEF1::Values> solvation_;
268
269 bool use_solvation_component_;
270
271 //_@}
272
273 };
274 } // namespace BALL
275
276 #endif // BALL_MOLMEC_CHARMM_CHARMMVDW_H