OEInteraction

Attention

This API is currently available in C++ and Python.

class OEInteraction

The OEInteraction class provides a general mechanism to report individual interactions calculated within a function or force field component. For instance, pairwise atom interactions in an intramolecular VdW component calculation can be obtained by the OEMolFunc.GetInteractions method that returns an iterator over the OEInteraction instances.

The OEInteraction class defines the following public methods:

Constructors

OEInteraction(arg2: OEInteractImpl) -> OEInteraction
OEInteraction(arg2: OEInteraction) -> OEInteraction

Default and copy constructors.

GetAtoms

GetAtoms() -> OEAtomIter

Returns an iterator over the atoms involved in the calculated interaction.

GetName

GetName() -> str

Returns a clear text human readable identifier for the type of interaction.

GetValues

GetValues(grads: OEDoubleArray = None) -> float

Returns the energy associated with the calculated interaction. The associated gradients may also be obtained by passing in an array of the length returned by the OEInteraction.NumValues method. The derivatives correspond to the atom ordering returned by the OEInteraction.GetAtoms method.

NumAtoms

NumAtoms() -> int

Returns the number of atoms involved in the calculated interactions. One-body interactions, such as an atom in a field, will only have one atom involved in the interaction. VdW interactions will consist of two atoms. Torsions are composed of four interacting atoms.

NumValues

NumValues() -> int

Returns the number of gradients associated with the particular interaction. For interactions calculated from Cartesian coordinates of atoms, this method will typically return three times the number of atoms involved in the interaction as x, y, and z gradient values are calculated for each atom.