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

.. oe:namespace:: OEConfGen

.. meta::
   :keywords: OETorDriveOptions, TorDriveOptions


.. _OEConfGen_OETorDriveOptions:

.. oe:class:: OETorDriveOptions

   .. oe:api::

      class OETorDriveOptions : public OESystem::OEOptions

   This class provides an interface to set up options required for generating an
   ensemble of molecule conformers by torsion driving from
   an initial 3D structure of a molecule.

   .. seealso::

      * :ref:`OETorDriver <OEConfGen_OETorDriver>` class
      * :ref:`OETorLib <OEConfGen_OETorLib>` class

   .. admonition:: Code Examples

      * :ref:`section_examples_torsion_drive` example

   The :ref:`OETorDriveOptions <OEConfGen_OETorDriveOptions>` class defines the following public methods:

    * :ref:`ExceedsMaxRotors<OEConfGen_OETorDriveOptions_ExceedsMaxRotors>`
    * :ref:`GetCommentEnergy<OEConfGen_OETorDriveOptions_GetCommentEnergy>` and
      :ref:`SetCommentEnergy<OEConfGen_OETorDriveOptions_SetCommentEnergy>`
    * :ref:`GetForceField<OEConfGen_OETorDriveOptions_GetForceField>` and
      :ref:`SetForceField<OEConfGen_OETorDriveOptions_SetForceField>`
    * :ref:`GetMaxRotors<OEConfGen_OETorDriveOptions_GetMaxRotors>` and
      :ref:`SetMaxRotors<OEConfGen_OETorDriveOptions_SetMaxRotors>`
    * :ref:`GetMaxSearchTime<OEConfGen_OETorDriveOptions_GetMaxSearchTime>` and
      :ref:`SetMaxSearchTime<OEConfGen_OETorDriveOptions_SetMaxSearchTime>`
    * :ref:`GetRotorOffset<OEConfGen_OETorDriveOptions_GetRotorOffset>` and
      :ref:`SetRotorOffset<OEConfGen_OETorDriveOptions_SetRotorOffset>`
    * :ref:`GetRotorPredicate<OEConfGen_OETorDriveOptions_GetRotorPredicate>` and
      :ref:`SetRotorPredicate<OEConfGen_OETorDriveOptions_SetRotorPredicate>`
    * :ref:`GetSDEnergy<OEConfGen_OETorDriveOptions_GetSDEnergy>` and
      :ref:`SetSDEnergy<OEConfGen_OETorDriveOptions_SetSDEnergy>`
    * :ref:`GetThompsonOptions<OEConfGen_OETorDriveOptions_GetThompsonOptions>` and
      :ref:`SetThompsonOptions<OEConfGen_OETorDriveOptions_SetThompsonOptions>`
    * :ref:`GetTorLib<OEConfGen_OETorDriveOptions_GetTorLib>` and
      :ref:`SetTorLib<OEConfGen_OETorDriveOptions_SetTorLib>`
    * :ref:`GetUseGPU<OEConfGen_OETorDriveOptions_GetUseGPU>` and
      :ref:`SetUseGPU<OEConfGen_OETorDriveOptions_SetUseGPU>`
    * :ref:`GetUseThompson<OEConfGen_OETorDriveOptions_GetUseThompson>` and
      :ref:`SetUseThompson<OEConfGen_OETorDriveOptions_SetUseThompson>`

   .. oe:method:: Constructors

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

         .. oe:api::

            OETorDriveOptions()
            OETorDriveOptions(const OETorDriveOptions &)

      .. oe:language:: python

         .. oe:api:: python

            OETorDriveOptions() -> OETorDriveOptions
            OETorDriveOptions(arg2: OETorDriveOptions) -> OETorDriveOptions

      Default and copy constructors.

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

      .. oe:api::

         OETorDriveOptions &operator=(const OETorDriveOptions &)
         Assignment operator.



   .. _OEConfGen_OETorDriveOptions_ExceedsMaxRotors:

   .. oe:method:: ExceedsMaxRotors

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

         .. oe:api::

            bool ExceedsMaxRotors(const OEChem::OEMolBase&) const

      .. oe:language:: python

         .. oe:api:: python

            ExceedsMaxRotors(argMol: Union[OEGraphMol,OEMol,OEQMol]) -> bool

      This method checks if the number of rotors in the molecule is within the
      currently specified limit. 
      See the :ref:`SetMaxRotors<OEConfGen_OETorDriveOptions_SetMaxRotors>` method.

   .. _OEConfGen_OETorDriveOptions_GetCommentEnergy:

   .. oe:method:: GetCommentEnergy

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

         .. oe:api::

            bool GetCommentEnergy() const

      .. oe:language:: python

         .. oe:api:: python

            GetCommentEnergy() -> bool

      See the :ref:`SetCommentEnergy<OEConfGen_OETorDriveOptions_SetCommentEnergy>` method.

   .. _OEConfGen_OETorDriveOptions_GetForceField:

   .. oe:method:: GetForceField

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

         .. oe:api::

            unsigned GetForceFieldType() const

      .. oe:language:: python

         .. oe:api:: python

            GetForceField() -> OEForceField

      See the :ref:`SetForceField<OEConfGen_OETorDriveOptions_SetForceField>` method.

   .. _OEConfGen_OETorDriveOptions_GetMaxRotors:



   .. oe:method:: GetMaxRotors


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

         .. oe:api::

            unsigned int GetMaxRotors() const

      .. oe:language:: python

         .. oe:api:: python

            GetMaxRotors() -> int

      See the :ref:`SetMaxRotors<OEConfGen_OETorDriveOptions_SetMaxRotors>` method.

   .. _OEConfGen_OETorDriveOptions_GetMaxSearchTime:



   .. oe:method:: GetMaxSearchTime


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

         .. oe:api::

            double GetMaxSearchTime() const

      .. oe:language:: python

         .. oe:api:: python

            GetMaxSearchTime() -> float

      See the :ref:`SetMaxSearchTime<OEConfGen_OETorDriveOptions_SetMaxSearchTime>` method.

   .. _OEConfGen_OETorDriveOptions_GetRotorOffset:



   .. oe:method:: GetRotorOffset


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

         .. oe:api::

            bool GetRotorOffset() const

      .. oe:language:: python

         .. oe:api:: python

            GetRotorOffset() -> bool

      See the :ref:`SetRotorOffset<OEConfGen_OETorDriveOptions_SetRotorOffset>` method.

   .. _OEConfGen_OETorDriveOptions_GetRotorPredicate:



   .. oe:method:: GetRotorPredicate


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

         .. oe:api::

            const OESystem::OEUnaryPredicate<OEChem::OEBondBase>* GetRotorPredicate() const

      .. oe:language:: python

         .. oe:api:: python

            GetRotorPredicate() -> OEUnaryBondPred

      See the :ref:`SetRotorPredicate<OEConfGen_OETorDriveOptions_SetRotorPredicate>` method.

   .. _OEConfGen_OETorDriveOptions_GetSDEnergy:



   .. oe:method:: GetSDEnergy


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

         .. oe:api::

            bool GetSDEnergy() const

      .. oe:language:: python

         .. oe:api:: python

            GetSDEnergy() -> bool

      See the :ref:`SetSDEnergy<OEConfGen_OETorDriveOptions_SetSDEnergy>` method.


   .. _OEConfGen_OETorDriveOptions_GetTorLib:

   .. oe:method:: GetTorLib

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

         .. oe:api::

            const OETorLib* GetTorLib() const

      .. oe:language:: python

         .. oe:api:: python

            GetTorLib() -> OETorLib

      See the :ref:`SetTorLib<OEConfGen_oetordriveoptions_SetTorLib>` method.


   .. _OEConfGen_OETorDriveOptions_GetUseGPU:

   .. oe:method:: GetUseGPU


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

         .. oe:api::

            bool GetUseGPU() const

      .. oe:language:: python

         .. oe:api:: python

            GetUseGPU() -> bool

      See the :ref:`SetUseGPU<OEConfGen_oetordriveoptions_SetUseGPU>` method.

   .. _OEConfGen_OETorDriveOptions_GetUseThompson:



   .. oe:method:: GetUseThompson


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

         .. oe:api::

            bool GetUseThompson() const

      .. oe:language:: python

         .. oe:api:: python

            GetUseThompson() -> bool

      See the :ref:`SetUseThompson<OEConfGen_oetordriveoptions_SetUseThompson>` method.




   .. _OEConfGen_OETorDriveOptions_SetCommentEnergy:



   .. oe:method:: SetCommentEnergy


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

         .. oe:api::

            bool SetCommentEnergy(const bool)

      .. oe:language:: python

         .. oe:api:: python

            SetCommentEnergy(value: bool) -> bool

      Sets whether to add **conformer energy** in kcal/mol into the comments
      that appear if the output is written to a MOL2 file.
      If *true*, the comment energy is written.
      Default: False

   .. _OEConfGen_OETorDriveOptions_SetForceField:



   .. oe:method:: SetForceField


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

         .. oe:api::

            bool SetForceField(const unsigned)
            bool SetForceField(const std::string&)

      .. oe:language:: python

         .. oe:api:: python

            SetForceField(value: int) -> bool
            SetForceField(value: str) -> bool
            SetForceField(value: oeistream) -> bool
            SetForceField(value: OEForceField) -> bool

      Sets the **force field** used for torsion driving. The first overload takes an `unsigned` 
      from the :ref:`OEMMFFSheffieldFFType <OEFF_OEMMFFSheffieldFFType>` constant namespace, and the second overload
      takes corresponding string values. The method returns *false* when the invalid selection
      is chosen and *true* otherwise.
      Default: :ref:`MMFF94Smod_NOESTAT <OEFF_OEMMFFSheffieldFFType_MMFF94Smod_NOESTAT>`

   .. _OEConfGen_OETorDriveOptions_SetMaxRotors:



   .. oe:method:: SetMaxRotors


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

         .. oe:api::

            bool SetMaxRotors(const unsigned int)

      .. oe:language:: python

         .. oe:api:: python

            SetMaxRotors(value: int) -> bool

      Sets the **limit of molecules with maximum number of rotors**
      that would be handled by torsion driving. If a value of 9999 or higher is
      defined, this limit is ignored.
      Default: 9999

   .. _OEConfGen_OETorDriveOptions_SetMaxSearchTime:



   .. oe:method:: SetMaxSearchTime


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

         .. oe:api::

            bool SetMaxSearchTime(const double)

      .. oe:language:: python

         .. oe:api:: python

            SetMaxSearchTime(value: float) -> bool

      Sets the **maximum time** that should be spent for the torsion
      driving of a molecule, in units of seconds.
      Default: 120.0 sec

   .. _OEConfGen_OETorDriveOptions_SetRotorOffset:
   
   .. oe:method:: SetRotorOffset


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

         .. oe:api::

            bool SetRotorOffset(const bool)

      .. oe:language:: python

         .. oe:api:: python

            SetRotorOffset(value: bool) -> bool

      Sets whether the **rotor offset compression** should be turned on.
      Turning on the rotor offset compression reduces the space required when
      saved in an OEB file.
      Default: False

   .. _OEConfGen_OETorDriveOptions_SetRotorPredicate:



   .. oe:method:: SetRotorPredicate


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

         .. oe:api::

            bool SetRotorPredicate(const OESystem::OEUnaryPredicate<OEChem::OEBondBase>&)

      .. oe:language:: python

         .. oe:api:: python

            SetRotorPredicate(value: OEUnaryBondPred) -> bool

      Sets the **predicate** that is used to decide whether a bond is
      *rotatable*.

   .. _OEConfGen_OETorDriveOptions_SetSDEnergy:



   .. oe:method:: SetSDEnergy


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

         .. oe:api::

            bool SetSDEnergy(const bool)

      .. oe:language:: python

         .. oe:api:: python

            SetSDEnergy(value: bool) -> bool

      Sets whether the **conformer energy** in kcal/mol should be stored as SD data.
      Default: False


   .. _OEConfGen_OETorDriveOptions_SetTorLib:

   .. oe:method:: SetTorLib

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

         .. oe:api::

            bool SetTorLib(const unsigned)
            bool SetTorLib(const std::string&)
            bool SetTorLib(const OETorLib&)

      .. oe:language:: python

         .. oe:api:: python

            SetTorLib(value: int) -> bool
            SetTorLib(value: str) -> bool
            SetTorLib(value: oeistream) -> bool
            SetTorLib(value: OETorLib) -> bool

      Sets the **torsion library** that is used for torsion driving.  The first overload
      takes an `unsigned` from the :ref:`OETorLibType <OEConfGen_OETorLibType>` constant namespace, and
      the second overload takes the corresponding string values.
      Default: :ref:`Original <OEConfGen_OETorLibType_Original>`

      .. seealso::

         * :ref:`OETorLib <OEConfGen_OETorLib>` class.
         * :ref:`OETorLibType <OEConfGen_OETorLibType>` constant namespace.

   .. _OEConfGen_OETorDriveOptions_SetUseGPU:



   .. oe:method:: SetUseGPU


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

         .. oe:api::

            bool SetUseGPU(const bool)

      .. oe:language:: python

         .. oe:api:: python

            SetUseGPU(value: bool) -> bool

      Sets whether to use the GPU implementation for torsion driving (**GPU-Omega**).
      The default is *true*, however, if no GPU is detected on your system, **Omega** will fall
      back to the CPU implementation. **GPU-Omega** is only available with the default
      force field :ref:`MMFF94Smod_NOESTAT <OEFF_OEMMFFSheffieldFFType_MMFF94Smod_NOESTAT>`.


   .. _OEConfGen_OETorDriveOptions_SetUseThompson:



   .. oe:method:: SetUseThompson


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

         .. oe:api::

            bool SetUseThompson(const bool)

      .. oe:language:: python

         .. oe:api:: python

            SetUseThompson(value: bool) -> bool

      Sets whether to use Thompson sampling for exploring the conformer space.
      The default is *false*, that is, **Omega** will use exhaustive sampling by default.
      If switched Thompson sampling is used, the parameters can be controlled by the
      :ref:`Thompson Options <OEConfGen_OEThompsonOptions>` class.

