Chemical Data Processing Library C++ API - Version 1.4.0
Public Member Functions | List of all members
CDPL::ForceField::MMFF94GradientCalculator< ValueType > Class Template Reference

Calculates the total MMFF94 force field energy and its gradient for a set of atom 3D coordinates. More...

#include <MMFF94GradientCalculator.hpp>

Public Member Functions

 MMFF94GradientCalculator ()
 Constructs the calculator without an associated ForceField::MMFF94InteractionData instance. More...
 
 MMFF94GradientCalculator (const MMFF94InteractionData &ia_data, std::size_t num_atoms)
 Constructs the calculator and associates it with the supplied ForceField::MMFF94InteractionData instance. More...
 
void setEnabledInteractionTypes (unsigned int types)
 Enables/disables specific MMFF94 interaction-type contributions. More...
 
unsigned int getEnabledInteractionTypes () const
 Returns the currently enabled interaction-type contributions. More...
 
void setup (const MMFF94InteractionData &ia_data, std::size_t num_atoms)
 Associates the calculator with the supplied ForceField::MMFF94InteractionData instance and atom count. More...
 
template<typename CoordsArray >
const ValueType & operator() (const CoordsArray &coords)
 Computes the total MMFF94 energy of the conformation specified by coords without calculating the gradient. More...
 
template<typename CoordsArray , typename GradVector >
const ValueType & operator() (const CoordsArray &coords, GradVector &grad)
 Computes the total MMFF94 energy and the per-atom gradient of the conformation specified by coords. More...
 
const ValueType & getTotalEnergy () const
 Returns the total MMFF94 energy computed by the most recent operator()() call. More...
 
const ValueType & getBondStretchingEnergy () const
 Returns the bond-stretching energy contribution computed by the most recent operator()() call. More...
 
const ValueType & getAngleBendingEnergy () const
 Returns the angle-bending energy contribution computed by the most recent operator()() call. More...
 
const ValueType & getStretchBendEnergy () const
 Returns the stretch-bend coupling energy contribution computed by the most recent operator()() call. More...
 
const ValueType & getOutOfPlaneBendingEnergy () const
 Returns the out-of-plane bending energy contribution computed by the most recent operator()() call. More...
 
const ValueType & getTorsionEnergy () const
 Returns the torsion energy contribution computed by the most recent operator()() call. More...
 
const ValueType & getElectrostaticEnergy () const
 Returns the electrostatic energy contribution computed by the most recent operator()() call. More...
 
const ValueType & getVanDerWaalsEnergy () const
 Returns the Van der Waals energy contribution computed by the most recent operator()() call. More...
 
const Util::BitSetgetFixedAtomMask () const
 Returns the bit mask flagging atoms whose gradient components are zeroed after evaluation. More...
 
void setFixedAtomMask (const Util::BitSet &mask)
 Sets the bit mask flagging atoms whose gradient components shall be zeroed after calculation. More...
 
void resetFixedAtomMask ()
 Clears the fixed-atom mask so that all atoms contribute to the gradient. More...
 

Detailed Description

template<typename ValueType>
class CDPL::ForceField::MMFF94GradientCalculator< ValueType >

Calculates the total MMFF94 force field energy and its gradient for a set of atom 3D coordinates.

The calculator takes a ForceField::MMFF94InteractionData instance and the atom count of the molecule and computes both the total MMFF94 energy and the analytical Cartesian gradient \( \partial E / \partial \mathbf{r}_i \) for each atom. The per-component energies are retained and made available via the dedicated accessors. A bit mask can be set to mark atoms whose gradient contributions are zeroed, freezing them during an energy minimization run.

Template Parameters
ValueTypeThe floating-point value type used to represent the computed energies and gradient vector elements.

Constructor & Destructor Documentation

◆ MMFF94GradientCalculator() [1/2]

template<typename ValueType >
CDPL::ForceField::MMFF94GradientCalculator< ValueType >::MMFF94GradientCalculator ( )

Constructs the calculator without an associated ForceField::MMFF94InteractionData instance.

operator()() will return zero until setup() has been called.

◆ MMFF94GradientCalculator() [2/2]

template<typename ValueType >
CDPL::ForceField::MMFF94GradientCalculator< ValueType >::MMFF94GradientCalculator ( const MMFF94InteractionData ia_data,
std::size_t  num_atoms 
)

Constructs the calculator and associates it with the supplied ForceField::MMFF94InteractionData instance.

Parameters
ia_dataThe MMFF94 interaction data to use during energy/gradient calculation.
num_atomsThe number of atoms in the parameterized molecular graph.

Member Function Documentation

◆ setEnabledInteractionTypes()

template<typename ValueType >
void CDPL::ForceField::MMFF94GradientCalculator< ValueType >::setEnabledInteractionTypes ( unsigned int  types)

Enables/disables specific MMFF94 interaction-type contributions.

Parameters
typesBitwise-OR combination of ForceField::InteractionType flags.
Note
Only enabled contributions are evaluated.

◆ getEnabledInteractionTypes()

template<typename ValueType >
unsigned int CDPL::ForceField::MMFF94GradientCalculator< ValueType >::getEnabledInteractionTypes ( ) const

Returns the currently enabled interaction-type contributions.

Returns
The bitwise-OR combination of ForceField::InteractionType flags.

◆ setup()

template<typename ValueType >
void CDPL::ForceField::MMFF94GradientCalculator< ValueType >::setup ( const MMFF94InteractionData ia_data,
std::size_t  num_atoms 
)

Associates the calculator with the supplied ForceField::MMFF94InteractionData instance and atom count.

Parameters
ia_dataThe new MMFF94 interaction data to use for energy/gradient calculation.
num_atomsThe number of atoms in the parameterized molecular graph.

◆ operator()() [1/2]

template<typename ValueType >
template<typename CoordsArray >
const ValueType& CDPL::ForceField::MMFF94GradientCalculator< ValueType >::operator() ( const CoordsArray &  coords)

Computes the total MMFF94 energy of the conformation specified by coords without calculating the gradient.

Template Parameters
CoordsArrayThe atom coordinate array type.
Parameters
coordsThe 3D coordinates of the molecule.
Returns
A const reference to the computed total energy.

◆ operator()() [2/2]

template<typename ValueType >
template<typename CoordsArray , typename GradVector >
const ValueType& CDPL::ForceField::MMFF94GradientCalculator< ValueType >::operator() ( const CoordsArray &  coords,
GradVector &  grad 
)

Computes the total MMFF94 energy and the per-atom gradient of the conformation specified by coords.

Gradients of atoms marked in the fixed-atom mask (see setFixedAtomMask()) are zeroed after calculation.

Template Parameters
CoordsArrayThe atom coordinate array type.
GradVectorThe gradient vector type (must satisfy ForceField::GradientVectorTraits requirements).
Parameters
coordsThe atom 3D coordinates.
gradThe output gradient vector.
Returns
A const reference to the computed total energy.

◆ getTotalEnergy()

template<typename ValueType >
const ValueType& CDPL::ForceField::MMFF94GradientCalculator< ValueType >::getTotalEnergy ( ) const

Returns the total MMFF94 energy computed by the most recent operator()() call.

Returns
A const reference to the total energy.

◆ getBondStretchingEnergy()

template<typename ValueType >
const ValueType& CDPL::ForceField::MMFF94GradientCalculator< ValueType >::getBondStretchingEnergy ( ) const

Returns the bond-stretching energy contribution computed by the most recent operator()() call.

Returns
A const reference to the bond-stretching energy.

◆ getAngleBendingEnergy()

template<typename ValueType >
const ValueType& CDPL::ForceField::MMFF94GradientCalculator< ValueType >::getAngleBendingEnergy ( ) const

Returns the angle-bending energy contribution computed by the most recent operator()() call.

Returns
A const reference to the angle-bending energy.

◆ getStretchBendEnergy()

template<typename ValueType >
const ValueType& CDPL::ForceField::MMFF94GradientCalculator< ValueType >::getStretchBendEnergy ( ) const

Returns the stretch-bend coupling energy contribution computed by the most recent operator()() call.

Returns
A const reference to the stretch-bend energy.

◆ getOutOfPlaneBendingEnergy()

template<typename ValueType >
const ValueType& CDPL::ForceField::MMFF94GradientCalculator< ValueType >::getOutOfPlaneBendingEnergy ( ) const

Returns the out-of-plane bending energy contribution computed by the most recent operator()() call.

Returns
A const reference to the out-of-plane bending energy.

◆ getTorsionEnergy()

template<typename ValueType >
const ValueType& CDPL::ForceField::MMFF94GradientCalculator< ValueType >::getTorsionEnergy ( ) const

Returns the torsion energy contribution computed by the most recent operator()() call.

Returns
A const reference to the torsion energy.

◆ getElectrostaticEnergy()

template<typename ValueType >
const ValueType& CDPL::ForceField::MMFF94GradientCalculator< ValueType >::getElectrostaticEnergy ( ) const

Returns the electrostatic energy contribution computed by the most recent operator()() call.

Returns
A const reference to the electrostatic energy.

◆ getVanDerWaalsEnergy()

template<typename ValueType >
const ValueType& CDPL::ForceField::MMFF94GradientCalculator< ValueType >::getVanDerWaalsEnergy ( ) const

Returns the Van der Waals energy contribution computed by the most recent operator()() call.

Returns
A const reference to the Van der Waals energy.

◆ getFixedAtomMask()

template<typename ValueType >
const Util::BitSet& CDPL::ForceField::MMFF94GradientCalculator< ValueType >::getFixedAtomMask ( ) const

Returns the bit mask flagging atoms whose gradient components are zeroed after evaluation.

Returns
A const reference to the fixed-atom bit mask.

◆ setFixedAtomMask()

template<typename ValueType >
void CDPL::ForceField::MMFF94GradientCalculator< ValueType >::setFixedAtomMask ( const Util::BitSet mask)

Sets the bit mask flagging atoms whose gradient components shall be zeroed after calculation.

Parameters
maskThe new fixed-atom bit mask (bit i set freezes atom i during minimization).

◆ resetFixedAtomMask()

template<typename ValueType >
void CDPL::ForceField::MMFF94GradientCalculator< ValueType >::resetFixedAtomMask ( )

Clears the fixed-atom mask so that all atoms contribute to the gradient.


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