IMP logo
IMP Reference Guide  develop.7482b7c7af, 2026/12/05
The Integrative Modeling Platform
RepulsiveDistancePairScore.h
Go to the documentation of this file.
1/**
2 * \file IMP/isd/RepulsiveDistancePairScore.h
3 * \brief A simple quadric repulsive term between two atoms. Restraint is zero
4 * when the distance equals the sum of the radii plus the shift.
5 *
6 * Copyright 2007-2022 IMP Inventors. All rights reserved.
7 */
8
9#ifndef IMPISD_REPULSIVE_DISTANCE_PAIR_SCORE_H
10#define IMPISD_REPULSIVE_DISTANCE_PAIR_SCORE_H
11
12#include <IMP/isd/isd_config.h>
13#include <IMP/core/XYZR.h>
14#include <IMP/PairScore.h>
15#include <IMP/Pointer.h>
16#include <IMP/generic.h>
17
18IMPISD_BEGIN_NAMESPACE
19
20//! A repulsive potential on the distance between two atoms
21/** \see XYZR
22 \see SphereDistancePairScore
23 \see DistancePairScore
24 \see LennardJonesTypedPairScore
25 */
26class IMPISDEXPORT RepulsiveDistancePairScore : public PairScore {
27 double x0_, k_;
28
29 public:
30 RepulsiveDistancePairScore(double d0, double k);
31
32 double get_rest_length() const { return x0_; }
33 double get_stiffness() const { return k_; }
34
35 virtual double evaluate_index(Model *m,
36 const ParticleIndexPair &p,
37 DerivativeAccumulator *da) const override;
39 Model *m, const ParticleIndexes &pis) const override;
40 IMP_PAIR_SCORE_METHODS(RepulsiveDistancePairScore);
41 IMP_OBJECT_METHODS(RepulsiveDistancePairScore);
42 ;
43};
44
46
47IMPISD_END_NAMESPACE
48
49#endif /* IMPISD_REPULSIVE_DISTANCE_PAIR_SCORE_H */
Define PairScore.
A nullptr-initialized pointer to an IMP Object.
Decorator for a sphere-like particle.
Class for adding derivatives from restraints to the model.
Class for storing model, its restraints, constraints, and particles.
Definition Model.h:111
A repulsive potential on the distance between two atoms.
virtual double evaluate_index(Model *m, const ParticleIndexPair &p, DerivativeAccumulator *da) const override
Compute the score and the derivative if needed.
virtual ModelObjectsTemp do_get_inputs(Model *m, const ParticleIndexes &pis) const override
Overload this method to specify the inputs.
Compile-time generic restraint and constraint support.
IMP::Vector< IMP::Pointer< RepulsiveDistancePairScore > > RepulsiveDistancePairScores
Vector< ParticleIndex, std::allocator< ParticleIndex > > ParticleIndexes
A list of particles, each identified by its ParticleIndex.
Definition base_types.h:199
Array< 2, ParticleIndex > ParticleIndexPair
An ordered pair of particles, each identified by its ParticleIndex.
Definition base_types.h:202
IMP::Vector< IMP::WeakPointer< ModelObject > > ModelObjectsTemp
Definition base_types.h:122
#define IMP_OBJECTS(Name, PluralName)
Define the types for storing lists of object pointers.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
#define IMP_PAIR_SCORE_METHODS(Name)
Definition pair_macros.h:25