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

.. oe:namespace:: OEMolSmirnoff



.. _OEMolSmirnoff_OESmirnoffTorsionData:

.. oe:class:: OESmirnoffTorsionData


   .. attention::

      |TWOLANGUAGE|

   .. oe:api::


      class OESmirnoffTorsionData : public OEMolSmirnoff::OESmirnoffData

   The OESmirnoffTorsionData class provides the ability to add new parameters and modify existing
   proper torsion parameters in the SMIRNOFF force field that has the functional
   form: :math:`V_t = \sum_n{V_n/d_n(1+\cos{(p_n\theta - \gamma_n)})}` (see :ref:`section_smirnoff`).


   .. seealso::

      * :ref:`OESmirnoffData <OEMolSmirnoff_OESmirnoffData>` class

   The following methods are publicly inherited from :ref:`OESmirnoffData <OEMolSmirnoff_OESmirnoffData>` class:

    * :oe:meth:`GetID<OEMolSmirnoff::OESmirnoffData::GetID>`
    * :oe:meth:`GetSmarts<OEMolSmirnoff::OESmirnoffData::GetSmarts>`

   The class defines the following public methods:

    * :oe:meth:`NumTerms<OEMolSmirnoff::OESmirnoffTorsionData::NumTerms>`
    * :oe:meth:`GetDegeneracy<OEMolSmirnoff::OESmirnoffTorsionData::GetDegeneracy>`
    * :oe:meth:`GetPeriodicity<OEMolSmirnoff::OESmirnoffTorsionData::GetPeriodicity>`
    * :oe:meth:`GetEneConst<OEMolSmirnoff::OESmirnoffTorsionData::GetEneConst>`
    * :oe:meth:`GetPhaseAngle<OEMolSmirnoff::OESmirnoffTorsionData::GetPhaseAngle>`
    * :oe:meth:`AddData<OEMolSmirnoff::OESmirnoffTorsionData::AddData>`
    * :oe:meth:`ClearData<OEMolSmirnoff::OESmirnoffTorsionData::ClearData>`

   .. oe:method:: Constructors

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

         .. oe:api::

            OESmirnoffTorsionData()
            OESmirnoffTorsionData(const std::string& id,
                                  const std::string& smarts)
            OESmirnoffTorsionData(const OESmirnoffTorsionData&)

      .. oe:language:: python

         .. oe:api:: python

            OESmirnoffTorsionData() -> OESmirnoffTorsionData
            OESmirnoffTorsionData(id: str, smarts: str) -> OESmirnoffTorsionData
            OESmirnoffTorsionData(arg2: OESmirnoffTorsionData) -> OESmirnoffTorsionData

   .. oe:method:: operator=
      :language: c++

      .. oe:api::

         OESmirnoffTorsionData& operator=(const OESmirnoffTorsionData&)

      Assignment operator.
            OESmirnoffTorsionData(id: str, smarts: str) -> OESmirnoffTorsionData
            OESmirnoffTorsionData(arg2: OESmirnoffTorsionData) -> OESmirnoffTorsionData


   .. oe:method:: NumTerms

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

         .. oe:api::

            unsigned NumTerms() const

      .. oe:language:: python

         .. oe:api:: python

            NumTerms() -> int

      Returns the total number of terms (:math:`n`)

   .. oe:method:: GetDegeneracy

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

         .. oe:api::

            unsigned GetDegeneracy(const unsigned index) const

      .. oe:language:: python

         .. oe:api:: python

            GetDegeneracy(index: int) -> int

      Returns the degeneracy (:math:`d_n`) of the OESmirnoffTorsionData term corresponding to the index

   .. oe:method:: GetPeriodicity

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

         .. oe:api::

            unsigned GetPeriodicity(const unsigned index) const

      .. oe:language:: python

         .. oe:api:: python

            GetPeriodicity(index: int) -> int

      Returns the periodicity of the cosine term (:math:`p_n`) of the OESmirnoffTorsionData term corresponding to the index

   .. oe:method:: GetEneConst

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

         .. oe:api::

            double GetEneConst(const unsigned index) const

      .. oe:language:: python

         .. oe:api:: python

            GetEneConst(index: int) -> float

      Returns the energy constant (:math:`V_n`) in kcal/mol multiplied to the cosine term of the OESmirnoffTorsionData term corresponding to the index

   .. oe:method:: GetPhaseAngle

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

         .. oe:api::

            double GetPhaseAngle(const unsigned index) const

      .. oe:language:: python

         .. oe:api:: python

            GetPhaseAngle(index: int) -> float

      Returns the phase (:math:`\gamma_n`) in degrees of the cosine term of the OESmirnoffTorsionData term corresponding to the index

   .. oe:method:: AddData

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

         .. oe:api::

            bool AddData(const unsigned degeneracy, const unsigned periodicity,
                         const double eneConst, const double phaseAngle)

      .. oe:language:: python

         .. oe:api:: python

            AddData(degeneracy: int, periodicity: int, eneConst: float,
                    phaseAngle: float) -> bool

      Used to add a OESmirnoffTorsionData term to a set of OESmirnoffParams

   .. oe:method:: ClearData

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

         .. oe:api::

            bool ClearData()

      .. oe:language:: python

         .. oe:api:: python

            ClearData() -> bool

      Clears the degeneracy, periodicity, energy constant and phase from a OESmirnoffTorsionData.
      The ID and Smarts associated with the OESmirnoffTorsionData are not cleared.
