class OEMolAdaptor : public OEOpt::OEAdaptor,
public OEMolPotential::OEMolFunc1
This OEMolAdaptor abstract class defines the interface
virtual double operator()(const double *var) virtual double operator()(const double *var, double *grad)
These pure virtual methods transform a set of variables, and call a
function evaluation using the transformed set of coordinates.
OEMolAdaptors contain an evaluation function used for energy
evaluations. Typical transformations involve conversion of variables
to a set of Cartesian coordinates for a molecule. In addition, the
second of the two methods transforms computed gradients back into the
coordinate type of the variables passed in the first argument. There
is a one to one correspondence between the elements of the variable
and gradient arrays (i.e. the first gradient element corresponds
to the first variable element). Methods that override the gradient
calculation operator must not initialize the gradient array, but
rather assume the array has already been initialized. By convention,
classes derived from OEOpt::OEOptimizer1 must initialize
gradient arrays before calling a function evaluation.
virtual bool AdaptVar(double *adaptedVar,const double *optVar) const
The AdaptVar method takes a set of variables as the second
argument and copies a set of transformed variables into the first
argument. This method is commonly used to transform optimized
variables back into the coordinate system of the original reference
variables.
virtual OESystem::OEIterBase<OEOpt::OEFComponent>
*GetFComponents(const double *coord)
This method takes a pointer to a set of Cartesian coordinates, and returns an iterator over the names and component energies (Section 3.4) calculated for the coordinates.
virtual OEMolFunc1 &GetMolFunc() const
\end{end}
This method returns a reference to the molecule function stored in a
OEMolAdaptor derived instance. \code{OEForceField} methods can be
accessed through this method as opposed to storing a reference or
pointer outside of the \code{OEMolAdaptor} derived class.
\subsection{GetVar}
\begin{verbatim}
virtual const double *GetVar(const double *refCoord)
The GetVar method takes reference variables as an argument, and
transforms them into the variable type or coordinate system that will
be used during an optimization. Reference variables normally use the
same coordinate system as the function evaluations that will be
performed in an optimization. Classes derived from
OEMolAdaptor will typically take Cartesian reference
coordinates as the argument to the GetVar method.
virtual unsigned int NumVar() const
This pure virtual method defines the interface for returning the
number of variables for which an OEMolAdaptor derived instance
has been initialized using the OEMolAdaptor::Setup method.
virtual bool Setup(const OEChem::OEMolBase &mol)
This pure virtual method defines the interface for preparing a
OEMolAdaptor derived class for energy and gradient
calculations. Necessary information required to perform coordinate
transformations will be stored in the OEMolAdaptor derived
instance. The OEMolFunc::Setup method(s) of functions
stored inside OEMolAdaptor derived instances will also be
called.