IMP logo
IMP Reference Guide  2.15.0
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-2021 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  IMP::PointerMember<SmoothingFunction> smoothing_function_;
31  double relative_dielectric_;
32  double multiplication_factor_;
33 
34  void calculate_multiplication_factor();
35 
36  public:
37  CoulombPairScore(SmoothingFunction *f) : smoothing_function_(f) {
38  set_relative_dielectric(1.0);
39  }
40 
41  void set_relative_dielectric(double relative_dielectric) {
42  relative_dielectric_ = relative_dielectric;
43  calculate_multiplication_factor();
44  }
45 
46  double get_relative_dielectric() const { return relative_dielectric_; }
47 
48  virtual double evaluate_index(Model *m,
49  const ParticleIndexPair &p,
52  Model *m, const ParticleIndexes &pis) const IMP_OVERRIDE;
55  ;
56 };
57 
59 
60 IMPATOM_END_NAMESPACE
61 
62 #endif /* IMPATOM_COULOMB_PAIR_SCORE_H */
Abstract class for scoring object(s) of type ParticleIndexPair.
Definition: PairScore.h:37
Macros for various classes.
Coulomb (electrostatic) score between a pair of particles.
#define IMP_PAIR_SCORE_METHODS(Name)
Definition: pair_macros.h:25
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition: object_macros.h:25
A more IMP-like version of the std::vector.
Definition: Vector.h:40
Class for storing model, its restraints, constraints, and particles.
Definition: Model.h:72
Define PairScore.
A smart pointer to a ref-counted Object that is a class member.
Definition: Pointer.h:146
virtual ModelObjectsTemp do_get_inputs(Model *m, const ParticleIndexes &pis) const =0
Overload this method to specify the inputs.
Classes to smooth nonbonded interactions.
#define IMP_OBJECTS(Name, PluralName)
Define the types for storing lists of object pointers.
Definition: object_macros.h:44
A nullptr-initialized pointer to an IMP Object.
Base class for smoothing nonbonded interactions as a function of distance.
virtual double evaluate_index(Model *m, const ParticleIndexPair &vt, DerivativeAccumulator *da) const =0
Compute the score and the derivative if needed.
#define IMP_OVERRIDE
Cause a compile error if this method does not override a parent method.
Class for adding derivatives from restraints to the model.
Compile-time generic restraint and constraint support.