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

.. oe:namespace:: OEMolPotential

.. meta::
   :keywords: OETorsionPotential, OEMolFunc2


.. _OEMolPotential_OETorsionPotential:

.. oe:class:: OETorsionPotential

   .. attention::

      |TWOLANGUAGE|

   .. oe:api::


      class OETorsionPotential : public virtual OEMolPotential::OEFFPotential

   The :ref:`OETorsionPotential <OEMolPotential_OETorsionPotential>` defines an interface for
   all torsional force field interaction potentials.

   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:`OEFunc2 <OEOpt_OEFunc2>`:
    * :oe:meth:`operator()<OEOpt::OEFunc2::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:`Setup<OEMolPotential::OEMolFunc::Setup>`

   The following methods are publicly inherited from :ref:`OEFFPotential <OEMolPotential_OEFFPotential>`:
    * :oe:meth:`Set<OEMolPotential::OEFFPotential::Set>`
    
   The :ref:`OETorsionPotential <OEMolPotential_OETorsionPotential>` implements the following methods:
    * :oe:meth:`Set<OEMolPotential::OETorsionPotential::Set>`


   .. oe:method:: Constructors

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

         .. oe:api::

            OETorsionPotential(const OEFFParams&)
            OETorsionPotential(const OETorsionPotential&)

      .. oe:language:: python

         .. oe:api:: python

            OETorsionPotential(fp: OEFFParams) -> OETorsionPotential
            OETorsionPotential(arg2: OETorsionPotential) -> OETorsionPotential

      Constructor and copy constructor.
 
   .. oe:method:: Assignment operator

      .. oe:api::

         OETorsionPotential& operator=(const OETorsionPotential&)

     Assignment operator.

   .. oe:method:: Set

      .. oe:api::

         bool Set(const OESystem::OEBinaryPredicate<OEChem::OEBondBase, OEChem::OEBondBase>&)

      This method provides interaction-level control of the torsion terms. The method tests the central 
      bond of a torsion angle. If such a bond returns `true` from the predicate test then all torsions 
      that cross the bond are included in the list of interactions to be calculated. 
      The :oe:meth:`Set<OEMolPotential::OETorsionPotential::Set>` method must be called before 
      the :oe:meth:`Setup<OEMolPotential::OEMolFunc::Setup>` for it to be effective.
