Chemical Data Processing Library Python API - Version 1.4.0
Public Member Functions | Properties | List of all members
CDPL.ForceField.MMFF94GradientCalculator Class Reference

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

+ Inheritance diagram for CDPL.ForceField.MMFF94GradientCalculator:

Public Member Functions

None __init__ ()
 Constructs the calculator without an associated ForceField.MMFF94InteractionData instance. More...
 
None __init__ (MMFF94GradientCalculator calc)
 Initializes a copy of the MMFF94GradientCalculator instance calc. More...
 
None __init__ (MMFF94InteractionData ia_data, int num_atoms)
 Constructs the calculator and associates it with the supplied ForceField.MMFF94InteractionData instance. More...
 
int getObjectID ()
 Returns the numeric identifier (ID) of the wrapped C++ class instance. More...
 
MMFF94GradientCalculator assign (MMFF94GradientCalculator calc)
 Replaces the current state of self with a copy of the state of the MMFF94GradientCalculator instance calc. More...
 
None setEnabledInteractionTypes (int types)
 Enables/disables specific MMFF94 interaction-type contributions. More...
 
int getEnabledInteractionTypes ()
 Returns the currently enabled interaction-type contributions. More...
 
None setup (MMFF94InteractionData ia_data, int num_atoms)
 Associates the calculator with the supplied ForceField.MMFF94InteractionData instance and atom count. More...
 
float getTotalEnergy ()
 Returns the total MMFF94 energy computed by the most recent call() call. More...
 
float getBondStretchingEnergy ()
 Returns the bond-stretching energy contribution computed by the most recent call() call. More...
 
float getAngleBendingEnergy ()
 Returns the angle-bending energy contribution computed by the most recent call() call. More...
 
float getStretchBendEnergy ()
 Returns the stretch-bend coupling energy contribution computed by the most recent call() call. More...
 
float getOutOfPlaneBendingEnergy ()
 Returns the out-of-plane bending energy contribution computed by the most recent call() call. More...
 
float getTorsionEnergy ()
 Returns the torsion energy contribution computed by the most recent call() call. More...
 
float getElectrostaticEnergy ()
 Returns the electrostatic energy contribution computed by the most recent call() call. More...
 
float getVanDerWaalsEnergy ()
 Returns the Van der Waals energy contribution computed by the most recent call() call. More...
 
None setFixedAtomMask (Util.BitSet mask)
 Sets the bit mask flagging atoms whose gradient components shall be zeroed after calculation. More...
 
None resetFixedAtomMask ()
 Clears the fixed-atom mask so that all atoms contribute to the gradient.
 
Util.BitSet getFixedAtomMask ()
 Returns the bit mask flagging atoms whose gradient components are zeroed after evaluation. More...
 
float __call__ (Math.Vector3DArray coords)
 Computes the total MMFF94 energy of the conformation specified by coords without calculating the gradient. More...
 
float __call__ (Math.Vector3DArray coords, Math.Vector3DArray grad)
 Computes the total MMFF94 energy and the per-atom gradient of the conformation specified by coords. More...
 

Properties

 objectID = property(getObjectID)
 
 enabledInteractionTypes = property(getEnabledInteractionTypes, setEnabledInteractionTypes)
 
 totalEnergy = property(getTotalEnergy)
 
 bondStretchingEnergy = property(getBondStretchingEnergy)
 
 angleBendingEnergy = property(getAngleBendingEnergy)
 
 stretchBendEnergy = property(getStretchBendEnergy)
 
 outOfPlaneBendingEnergy = property(getOutOfPlaneBendingEnergy)
 
 torsionEnergy = property(getTorsionEnergy)
 
 electrostaticEnergy = property(getElectrostaticEnergy)
 
 vanDerWaalsEnergy = property(getVanDerWaalsEnergy)
 
 fixedAtomMask = property(getFixedAtomMask)
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ __init__() [1/3]

None CDPL.ForceField.MMFF94GradientCalculator.__init__ ( )

Constructs the calculator without an associated ForceField.MMFF94InteractionData instance.

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

◆ __init__() [2/3]

None CDPL.ForceField.MMFF94GradientCalculator.__init__ ( MMFF94GradientCalculator  calc)

Initializes a copy of the MMFF94GradientCalculator instance calc.

Parameters
calcThe MMFF94GradientCalculator instance to copy.

◆ __init__() [3/3]

None CDPL.ForceField.MMFF94GradientCalculator.__init__ ( MMFF94InteractionData  ia_data,
int  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

◆ getObjectID()

int CDPL.ForceField.MMFF94GradientCalculator.getObjectID ( )

Returns the numeric identifier (ID) of the wrapped C++ class instance.

Different Python MMFF94GradientCalculator instances may reference the same underlying C++ class instance. The commonly used Python expression a is not b thus cannot tell reliably whether the two MMFF94GradientCalculator instances a and b reference different C++ objects. The numeric identifier returned by this method allows to correctly implement such an identity test via the simple expression a.getObjectID() != b.getObjectID().

Returns
The numeric ID of the internally referenced C++ class instance.

◆ assign()

MMFF94GradientCalculator CDPL.ForceField.MMFF94GradientCalculator.assign ( MMFF94GradientCalculator  calc)

Replaces the current state of self with a copy of the state of the MMFF94GradientCalculator instance calc.

Parameters
calcThe MMFF94GradientCalculator instance to copy.
Returns
self

◆ setEnabledInteractionTypes()

None CDPL.ForceField.MMFF94GradientCalculator.setEnabledInteractionTypes ( int  types)

Enables/disables specific MMFF94 interaction-type contributions.

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

◆ getEnabledInteractionTypes()

int CDPL.ForceField.MMFF94GradientCalculator.getEnabledInteractionTypes ( )

Returns the currently enabled interaction-type contributions.

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

◆ setup()

None CDPL.ForceField.MMFF94GradientCalculator.setup ( MMFF94InteractionData  ia_data,
int  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.

◆ getTotalEnergy()

float CDPL.ForceField.MMFF94GradientCalculator.getTotalEnergy ( )

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

Returns
A reference to the total energy.

◆ getBondStretchingEnergy()

float CDPL.ForceField.MMFF94GradientCalculator.getBondStretchingEnergy ( )

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

Returns
A reference to the bond-stretching energy.

◆ getAngleBendingEnergy()

float CDPL.ForceField.MMFF94GradientCalculator.getAngleBendingEnergy ( )

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

Returns
A reference to the angle-bending energy.

◆ getStretchBendEnergy()

float CDPL.ForceField.MMFF94GradientCalculator.getStretchBendEnergy ( )

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

Returns
A reference to the stretch-bend energy.

◆ getOutOfPlaneBendingEnergy()

float CDPL.ForceField.MMFF94GradientCalculator.getOutOfPlaneBendingEnergy ( )

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

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

◆ getTorsionEnergy()

float CDPL.ForceField.MMFF94GradientCalculator.getTorsionEnergy ( )

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

Returns
A reference to the torsion energy.

◆ getElectrostaticEnergy()

float CDPL.ForceField.MMFF94GradientCalculator.getElectrostaticEnergy ( )

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

Returns
A reference to the electrostatic energy.

◆ getVanDerWaalsEnergy()

float CDPL.ForceField.MMFF94GradientCalculator.getVanDerWaalsEnergy ( )

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

Returns
A reference to the Van der Waals energy.

◆ setFixedAtomMask()

None CDPL.ForceField.MMFF94GradientCalculator.setFixedAtomMask ( 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).

◆ getFixedAtomMask()

Util.BitSet CDPL.ForceField.MMFF94GradientCalculator.getFixedAtomMask ( )

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

Returns
A reference to the fixed-atom bit mask.

◆ __call__() [1/2]

float CDPL.ForceField.MMFF94GradientCalculator.__call__ ( Math.Vector3DArray  coords)

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

Parameters
coordsThe 3D coordinates of the molecule.
Returns
A reference to the computed total energy.

◆ __call__() [2/2]

float CDPL.ForceField.MMFF94GradientCalculator.__call__ ( Math.Vector3DArray  coords,
Math.Vector3DArray  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.

Parameters
coordsThe atom 3D coordinates.
gradThe output gradient vector.
Returns
A reference to the computed total energy.