IMP logo
IMP Reference Guide  develop.7482b7c7af, 2026/12/05
The Integrative Modeling Platform
IMP::atom::ForceSwitch Class Referencefinal

Smooth interaction scores by switching the derivatives (force switch). More...

#include <IMP/atom/smoothing_functions.h>

Inheritance diagram for IMP::atom::ForceSwitch:

Detailed Description

Smooth interaction scores by switching the derivatives (force switch).

This function leaves the scores unaffected for distances below or equal to min_distance, returns zero for distances above max_distance, and between the two thresholds smoothes the score such that its first derivatives drop linearly, i.e. the score is simply multiplied by

\[ \begin{cases} 1 & d \leq d_{min} \ \frac{(d_{max} - d)^2 (d_{max} + 2d - 3d_{min})} {(d_{max} - d_{min})^3} & d_{min} < d \leq d_{max} \ 0 & d > d_{max} \end{cases} \]

where \(d\) is the distance, and \(d_{min}\) and \(d_{max}\) are the thresholds set in the ForceSwitch constructor.

This behavior is roughly equivalent to CHARMM's force switch nonbonded interaction smoothing (which is also the smoothing mechanism used by MODELLER).

See also
CoulombPairScore

Definition at line 72 of file smoothing_functions.h.

Public Member Functions

 ForceSwitch (double min_distance, double max_distance)
double get_max_distance () const
double get_min_distance () const
virtual std::string get_type_name () const override
virtual ::IMP::VersionInfo get_version_info () const override
 Get information about the module and version of the object.
DerivativePair operator() (double score, double deriv, double distance) const override
 Smooth the score and its first derivative at a given distance.
double operator() (double score, double distance) const override
 Smooth the score at a given distance.
Public Member Functions inherited from IMP::Object
CheckLevel get_check_level () const
 get_derived_object (self)
 Return this object cast to the most derived subclass.
LogLevel get_log_level () const
void set_check_level (CheckLevel l)
void set_log_level (LogLevel l)
 Set the logging level used in this object.
const std::string & get_name () const
 Get the (not necessarily unique) name of this object.
void set_name (std::string name)
void set_was_used (bool tf) const
void show (std::ostream &out=std::cout) const
virtual void clear_caches ()

Additional Inherited Members

Protected Member Functions inherited from IMP::Object
 Object (std::string name)
 Construct an object with the given name.
virtual void do_destroy ()

Constructor & Destructor Documentation

◆ ForceSwitch()

IMP::atom::ForceSwitch::ForceSwitch ( double min_distance,
double max_distance )

Definition at line 98 of file smoothing_functions.h.

◆ ~ForceSwitch()

virtual IMP::atom::ForceSwitch::~ForceSwitch ( )
virtual

Definition at line 123 of file smoothing_functions.h.

Member Function Documentation

◆ get_max_distance()

double IMP::atom::ForceSwitch::get_max_distance ( ) const

Definition at line 108 of file smoothing_functions.h.

◆ get_min_distance()

double IMP::atom::ForceSwitch::get_min_distance ( ) const

Definition at line 107 of file smoothing_functions.h.

◆ get_type_name()

virtual std::string IMP::atom::ForceSwitch::get_type_name ( ) const
overridevirtual

Reimplemented from IMP::Object.

Definition at line 123 of file smoothing_functions.h.

◆ get_version_info()

virtual ::IMP::VersionInfo IMP::atom::ForceSwitch::get_version_info ( ) const
overridevirtual

Get information about the module and version of the object.

Reimplemented from IMP::Object.

Definition at line 123 of file smoothing_functions.h.

◆ operator()() [1/2]

DerivativePair IMP::atom::ForceSwitch::operator() ( double score,
double deriv,
double distance ) const
overridevirtual

Smooth the score and its first derivative at a given distance.

Returns
a DerivativePair containing the smoothed score and its first derivative.

Implements IMP::atom::SmoothingFunction.

Definition at line 115 of file smoothing_functions.h.

◆ operator()() [2/2]

double IMP::atom::ForceSwitch::operator() ( double score,
double distance ) const
overridevirtual

Smooth the score at a given distance.

Returns
the smoothed score.

Implements IMP::atom::SmoothingFunction.

Definition at line 110 of file smoothing_functions.h.


The documentation for this class was generated from the following file: