.. include:: ../../toolkit-substitutions

.. oe:namespace:: OEMolPotential



.. meta::
   :keywords: OEMolAdaptor, MolAdaptor


.. _OEMolPotential_OEMolAdaptor:

.. oe:class:: OEMolAdaptor

   .. attention::

      |TWOLANGUAGE|

   .. oe:api::


      class OEMolAdaptor : public OEOpt::OEAdaptor, public OEMolPotential:: OEMolFunc1

   The :ref:`OEMolAdaptor <OEMolPotential_OEMolAdaptor>` class is a pure virtual base class which defines the interface for
   classes which adapt or transform molecular coordinates  and gradients during an optimization.
   Adaptors are useful in cases where energy and gradients evaluation for a molecule or conformation
   are performed in Cartesian coordinates, but the optimization is done in different coordinate
   system, for example in torsion space.

   .. _figure_OEMolAdaptor_Hierarchy:

   .. figure:: ../images/OEMolAdaptor.*
      :align:  center     

   The following methods are publicly inherited from :ref:`OEAdaptor <OEOpt_OEAdaptor>`:
    * :oe:meth:`AdaptVar<OEOpt::OEAdaptor::AdaptVar>` 
    * :oe:meth:`GetVar<OEOpt::OEAdaptor::GetVar>`

   The following methods are publicly inherited from :ref:`OEFunc0 <OEOpt_OEFunc0>`:
    * :oe:meth:`operator()<OEOpt::OEFunc0::operator()>`         
    * :oe:meth:`GetFComponents<OEOpt::OEFunc0::GetFComponents>` 
    * :oe:meth:`NumVar<OEOpt::OEFunc0::NumVar>`

   The following methods are publicly inherited from :ref:`OEFunc1 <OEOpt_OEFunc1>`:
    * :oe:meth:`operator()<OEOpt::OEFunc1::operator()>`
   
   The following methods are publicly inherited from :ref:`OEMolFunc <OEMolPotential_OEMolFunc>`:
    * :oe:meth:`Clear<OEMolPotential::OEMolFunc::Clear>`   
    * :oe:meth:`ClearPredicates<OEMolPotential::OEMolFunc::ClearPredicates>`
    * :oe:meth:`GetInteractions<OEMolPotential::OEMolFunc::GetInteractions>`
    * :oe:meth:`Set<OEMolPotential::OEMolFunc::Set>`
    * :oe:meth:`Setup<OEMolPotential::OEMolFunc::Setup>`

   The :ref:`OEMolAdaptor <OEMolPotential_OEMolAdaptor>` class defines the following public methods:
    * :oe:meth:`SetMolFunc<OEMolPotential::OEMolAdaptor::SetMolFunc>`

   The following classes derive from this class:  
    * :ref:`OEInterAdaptor <OEMolPotential_OEInterAdaptor>`
    * :ref:`OEMolAdaptor2 <OEMolPotential_OEMolAdaptor2>`
    * :ref:`OEQuatAdaptor <OEMolPotential_OEQuatAdaptor>`
    * :ref:`OESubsetAdaptor <OEMolPotential_OESubsetAdaptor>`
    * :ref:`OETorAdaptor <OEMolPotential_OETorAdaptor>`
    * :ref:`OETorQuatAdaptor <OEMolPotential_OETorQuatAdaptor>`


   .. oe:method:: SetMolFunc

      .. oe:language:: c++ java csharp

         .. oe:api::

            bool SetMolFunc(OEMolFunc1& molfunc, bool own)=0

      .. oe:language:: python

         .. oe:api:: python

            SetMolFunc(molfunc: OEMolFunc1, own: bool) -> bool

      Defines the interface for resetting the molecule function within a 
      :ref:`OEMolAdaptor <OEMolPotential_OEMolAdaptor>` derived instance. Any molecule functions which are
      "owned" at the time of calling this method will be deleted. If the value of a second argument 
      passed to the method is ``true``, the adaptor derived from :ref:`OEMolAdaptor <OEMolPotential_OEMolAdaptor>`
      will take ownership of the memory of the molecule function, and will call the molecule function's 
      delete operator when either the destructor or the current method is called.  

 
