# 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(OEInteractImpl &)
OEInteraction(const OEInteraction &)


Default and copy constructors.

## operator=¶

OEInteraction &operator=(const OEInteraction &)


## GetAtoms¶

OESystem::OEIterBase<OEChem::OEAtomBase> *GetAtoms() const


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

## GetName¶

const char *GetName() const


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

## GetValues¶

double GetValues(double *grads=0) const


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¶

unsigned NumAtoms() const


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¶

unsigned NumValues() const


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.