IMP logo
IMP Reference Guide  2.20.0
The Integrative Modeling Platform
DihedralSingletonScore.h
Go to the documentation of this file.
1 /**
2  * \file IMP/atom/DihedralSingletonScore.h
3  * \brief A score on a dihedral angle.
4  *
5  * Copyright 2007-2022 IMP Inventors. All rights reserved.
6  */
7 
8 #ifndef IMPATOM_DIHEDRAL_SINGLETON_SCORE_H
9 #define IMPATOM_DIHEDRAL_SINGLETON_SCORE_H
10 
11 #include <IMP/atom/atom_config.h>
12 #include <IMP/SingletonScore.h>
13 #include <IMP/singleton_macros.h>
14 #include <cereal/access.hpp>
15 #include <cereal/types/base_class.hpp>
16 #include <cereal/types/polymorphic.hpp>
17 
18 IMPATOM_BEGIN_NAMESPACE
19 
20 //! Score the dihedral angle.
21 /** This scores the dihedral using information stored in its Dihedral
22  decorator. The form of the score is \f[
23  \frac{1}{2} s|s| + s^2\cos(\chi m + \chi_i))
24  \f] where \f$s\f$ is the stiffness, \f$m\f$ the multiplicity, \f$\chi_i\f$
25  the ideal value of the dihedral, and \f$\chi\f$ the actual value.
26 
27  \note This score matches the CHARMM definition, but may not match
28  other forcefields. The stiffness can be negative, which corresponds
29  to CHARMM forcefield entries with negative force constants.
30 
31  \see CHARMMParameters::create_dihedrals(), Dihedral.
32  */
33 class IMPATOMEXPORT DihedralSingletonScore : public SingletonScore {
34  public:
36  virtual double evaluate_index(Model *m, ParticleIndex p,
37  DerivativeAccumulator *da) const override;
39  Model *m, const ParticleIndexes &pis) const override;
42 
43  private:
44  friend class cereal::access;
45 
46  template<class Archive> void serialize(Archive &ar) {
47  ar(cereal::base_class<SingletonScore>(this));
48  }
50 };
51 
53 
54 IMPATOM_END_NAMESPACE
55 
56 #endif /* IMPATOM_DIHEDRAL_SINGLETON_SCORE_H */
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition: object_macros.h:25
Macros for various classes.
A more IMP-like version of the std::vector.
Definition: Vector.h:42
Class for storing model, its restraints, constraints, and particles.
Definition: Model.h:86
Abstract class for scoring object(s) of type ParticleIndex.
#define IMP_SINGLETON_SCORE_METHODS(Name)
#define IMP_OBJECT_SERIALIZE_DECL(Name)
Declare methods needed for serialization of Object pointers.
Definition: object_macros.h:95
virtual ModelObjectsTemp do_get_inputs(Model *m, const ParticleIndexes &pis) const =0
Overload this method to specify the inputs.
Define SingletonScore.
#define IMP_OBJECTS(Name, PluralName)
Define the types for storing lists of object pointers.
Definition: object_macros.h:44
virtual double evaluate_index(Model *m, ParticleIndex vt, DerivativeAccumulator *da) const =0
Compute the score and the derivative if needed.
Class for adding derivatives from restraints to the model.