BALL  1.4.79
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
amberNonBonded.h
Go to the documentation of this file.
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
16 #endif
17 
18 #ifndef BALL_MOLMEC_PARAMETER_POTENTIAL1210_H
20 #endif
21 
22 #ifndef BALL_MOLMEC_COMMON_FORCEFIELDCOMPONENT_H
24 #endif
25 
26 #ifndef BALL_MOLMEC_COMMON_SUPPORT_H
28 #endif
29 
30 namespace BALL
31 {
32  class AdvancedElectrostatic;
33 
39  : public ForceFieldComponent
40  {
41  public:
42 
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 
52 
54 
55 
58  ;
59 
62  AmberNonBonded(ForceField& force_field)
63  ;
64 
67  AmberNonBonded(const AmberNonBonded& amber_non_bonded)
68  ;
69 
72  virtual ~AmberNonBonded()
73  ;
75 
79 
82  const AmberNonBonded& operator = (const AmberNonBonded& anb)
83  ;
84 
87  virtual void clear()
88  ;
89 
91 
94 
97  bool operator == (const AmberNonBonded& anb)
98  ;
99 
101 
104 
107  virtual bool setup()
108  throw(Exception::TooManyErrors);
109 
110 
112  bool setup(Options& options, ForceFieldParameters& par);
113 
114 
116 
119 
122  virtual double updateEnergy()
123  ;
124 
127  virtual void updateForces()
128  ;
129 
135  virtual void update()
136  throw(Exception::TooManyErrors);
137 
138 
140  void update(const std::vector<std::pair<Atom*, Atom*> >& atom_vector);
141 
142 
145  virtual double getElectrostaticEnergy() const
146  ;
147 
150  virtual double getVdwEnergy() const
151  ;
152 
154 
157 
160  virtual MolmecSupport::PairListAlgorithmType
161  determineMethodOfAtomPairGeneration()
162  ;
163 
166  virtual void buildVectorOfNonBondedAtomPairs
167  (const std::vector<std::pair<Atom*, Atom*> >& atom_vector,
168  const LennardJones& lennard_jones,
169  const Potential1210& hydrogen_bond)
170  throw(Exception::TooManyErrors);
171 
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
#define BALL_CREATE(name)
Definition: create.h:62
#define BALL_EXPORT
Definition: COMMON/global.h:50
static const double ELECTROSTATIC_FACTOR