IMP  2.0.1
The Integrative Modeling Platform
CoulombPairScore.h
Go to the documentation of this file.
1 /**
2  * \file IMP/atom/CoulombPairScore.h
3  * \brief Coulomb (electrostatic) score between a pair of particles.
4  *
5  * Copyright 2007-2013 IMP Inventors. All rights reserved.
6  */
7 
8 #ifndef IMPATOM_COULOMB_PAIR_SCORE_H
9 #define IMPATOM_COULOMB_PAIR_SCORE_H
10 
11 #include <IMP/atom/atom_config.h>
12 #include <IMP/generic.h>
13 #include <IMP/PairScore.h>
14 #include <IMP/Pointer.h>
16 #include <IMP/pair_macros.h>
17 
18 IMPATOM_BEGIN_NAMESPACE
19 
20 //! Coulomb (electrostatic) score between a pair of particles.
21 /** The two particles in the pair must be Charged particles.
22  The form of the potential is \f[
23  \frac{1}{4\pi\epsilon_0\epsilon_r} \frac{q_i q_j}{|r_{ij}|}
24  \f] where \f$\epsilon_0\f$ is the permittivity of vacuum,
25  \f$\epsilon_r\f$ the relative dielectric (adjustable; 1.0 by default),
26  \f$q_i\f$ and \f$q_j\f$ the charges on the two particles,
27  and \f$|r_{ij}|\f$ the distance between them.
28  */
29 class IMPATOMEXPORT CoulombPairScore : public PairScore
30 {
31  IMP::OwnerPointer<SmoothingFunction> smoothing_function_;
32  double relative_dielectric_;
33  double multiplication_factor_;
34 
35  void calculate_multiplication_factor();
36 
37 public:
38  CoulombPairScore(SmoothingFunction *f) : smoothing_function_(f) {
39  set_relative_dielectric(1.0);
40  }
41 
42  void set_relative_dielectric(double relative_dielectric) {
43  relative_dielectric_ = relative_dielectric;
44  calculate_multiplication_factor();
45  }
46 
47  double get_relative_dielectric() const { return relative_dielectric_; }
48 
50 };
51 
53 
54 IMPATOM_END_NAMESPACE
55 
56 #endif /* IMPATOM_COULOMB_PAIR_SCORE_H */