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

.. oe:namespace:: OESz

.. meta::
   :keywords: OELigandOptOptions


.. _OESz_OELigandOptOptions:

.. oe:class:: OELigandOptOptions

   .. attention::

      |PRELIMINARY-API|

   .. oe:api::

      class OELigandOptOptions

   This class provides an interface to modify the options for FF optimization of a ligand molecule.

   .. seealso::

      * :ref:`OELigandOptResults <OESz_OELigandOptResults>` class

   The :ref:`OELigandOptOptions <OESz_OELigandOptOptions>` class defines the following public methods:
    * :oe:meth:`GetForceField<OESz::OELigandOptOptions::GetForceField>`
    * :oe:meth:`GetForceFieldType<OESz::OELigandOptOptions::GetForceFieldType>`
    * :oe:meth:`GetLigandCharge<OESz::OELigandOptOptions::GetLigandCharge>`
    * :oe:meth:`GetLigandChargeType<OESz::OELigandOptOptions::GetLigandChargeType>`
    * :oe:meth:`GetNonBondCutoff<OESz::OELigandOptOptions::GetNonBondCutoff>`
    * :oe:meth:`GetGradTolerance<OESz::OELigandOptOptions::GetGradTolerance>`
    * :oe:meth:`GetMaxIter<OESz::OELigandOptOptions::GetMaxIter>`
    * :oe:meth:`GetSolventModel<OESz::OELigandOptOptions::GetSolventModel>`
    * :oe:meth:`SetForceField<OESz::OELigandOptOptions::SetForceField>`
    * :oe:meth:`SetLigandCharge<OESz::OELigandOptOptions::SetLigandCharge>`
    * :oe:meth:`SetNonBondCutoff<OESz::OELigandOptOptions::SetNonBondCutoff>`
    * :oe:meth:`SetGradTolerance<OESz::OELigandOptOptions::SetGradTolerance>`
    * :oe:meth:`SetMaxIter<OESz::OELigandOptOptions::SetMaxIter>`
    * :oe:meth:`SetSolventModel<OESz::OELigandOptOptions::SetSolventModel>`


   .. oe:method:: Constructor

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

         .. oe:api::

            OELigandOptOptions()
            OELigandOptOptions(const OELigandOptOptions&)

      .. oe:language:: python

         .. oe:api:: python

            OELigandOptOptions() -> OELigandOptOptions
            OELigandOptOptions(arg2: OELigandOptOptions) -> OELigandOptOptions

      Default and copy constructors.


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

      .. oe:api::

         OELigandOptOptions& operator=(const OELigandOptOptions&)


.. _OESz_OELigandOptOptions_GetForceField:

      Assignment operator.


   .. oe:method:: GetForceField

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

         .. oe:api::

            const OEMolPotential::OEForceField* GetForceField() const

      .. oe:language:: python

         .. oe:api:: python

            GetForceField() -> OEForceField

      Returns pointer to the force field used in the optimization. ** Default ** :ref:`SAGE_OPENFF <OESz_OEForceFieldType_SAGE_OPENFF>`.


.. _OESz_OELigandOptOptions_GetForceFieldType:


   .. oe:method:: GetForceFieldType

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

         .. oe:api::

            unsigned int GetForceFieldType() const

      .. oe:language:: python

         .. oe:api:: python

            GetForceFieldType() -> int

      Returns the force field type used for the calculations, as `unsigned int`
      from the :oe:constns:`OESz::OEForceFieldType` namespace.  ** Default ** :ref:`SAGE_OPENFF <OESz_OEForceFieldType_SAGE_OPENFF>`.


.. _OESz_OELigandOptOptions_GetLigandCharge:

   .. oe:method:: GetLigandCharge

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

         .. oe:api::

            const OEProton::OEChargeEngineBase* GetLigandCharge() const

      .. oe:language:: python

         .. oe:api:: python

            GetLigandCharge() -> OEChargeEngineBase

      Returns the charge engine used for the calculations. See :oe:meth:`SetLigandCharge<OESz::OELigandOptOptions::SetLigandCharge>` method.
      ** Default ** :ref:`OEChargeEngineNoOp <OEProton_OEChargeEngineNoOp>`.


.. _OESz_OELigandOptOptions_GetLigandChargeType:

   .. oe:method:: GetLigandChargeType

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

         .. oe:api::

            unsigned int GetLigandChargeType() const

      .. oe:language:: python

         .. oe:api:: python

            GetLigandChargeType() -> int

      Returns the charge type to be used for the calculations, as `unsigned int` from
      the :oe:const:`OESz::OELigandChargeType`. **Default:** :oe:const:`OESz::OELigandChargeType::CURRENT`




.. _OESz_OELigandOptOptions_GetNonBondCutoff:

   .. oe:method:: GetNonBondCutoff

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

         .. oe:api::

            double GetNonBondCutoff() const

      .. oe:language:: python

         .. oe:api:: python

            GetNonBondCutoff() -> float

      See :oe:meth:`SetNonBondCutoff<OESz::OELigandOptOptions::SetNonBondCutoff>` method



.. _OESz_OELigandOptOptions_GetGradTolerance:

   .. oe:method:: GetGradTolerance

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

         .. oe:api::

            double GetGradTolerance() const

      .. oe:language:: python

         .. oe:api:: python

            GetGradTolerance() -> float

      See :oe:meth:`SetGradTolerance<OESz::OELigandOptOptions::SetGradTolerance>` method


.. _OESz_OELigandOptOptions_GetMaxIter:

   .. oe:method:: GetMaxIter

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

         .. oe:api::

            unsigned GetMaxIter() const

      .. oe:language:: python

         .. oe:api:: python

            GetMaxIter() -> int

      See :oe:meth:`SetMaxIter<OESz::OELigandOptOptions::SetMaxIter>` method



.. _OESz_OELigandOptOptions_GetSolventModel:

   .. oe:method:: GetSolventModel

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

         .. oe:api::

            unsigned GetSolventModel() const

      .. oe:language:: python

         .. oe:api:: python

            GetSolventModel() -> int

      See :oe:meth:`SetSolventModel<OESz::OELigandOptOptions::SetSolventModel>` method



.. _OESz_OELigandOptOptions_SetForceField:

   .. oe:method:: SetForceField

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

         .. oe:api::

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

      .. oe:language:: python

         .. oe:api:: python

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


      Sets force field to be used. Method takes either an `unsigned`
      from the  :oe:constns:`OESz::OEForceFieldType` namespace, or the takes corresponding
      string value, or a custom forcefield. Available predefined values are:
      :ref:`MMFF94 <OESz_OEForceFieldType_MMFF94>`, :ref:`MMFF94S <OESz_OEForceFieldType_MMFF94S>`,
      :ref:`PARSLEY_OPENFF <OESz_OEForceFieldType_PARSLEY_OPENFF>`, and :ref:`SAGE_OPENFF <OESz_OEForceFieldType_SAGE_OPENFF>`.
      Default: `sage`



.. _OESz_OELigandOptOptions_SetLigandCharge:

   .. oe:method:: SetLigandCharge

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

         .. oe:api::

            bool SetLigandCharge(const unsigned)
            bool SetLigandCharge(const std::string&)
            bool SetLigandCharge(const OEProton::OEChargeEngineBase&)

      .. oe:language:: python

         .. oe:api:: python

            SetLigandCharge(value: int) -> bool
            SetLigandCharge(value: str) -> bool
            SetLigandCharge(value: oeistream) -> bool
            SetLigandCharge(value: OEChargeEngineBase) -> bool

      Selects the method for ligand partial charges assigment. Method takes either an `unsigned`
      from the :oe:constns:`OESz::OELigandChargeType` namespace, or the takes corresponding string value,
      or a user-defined instance of :ref:`OEChargeEngineBase <OEProton_OEChargeEngineBase>`.
      It returns ``false`` when the invalid selection is chosen, ``true`` otherwise.
      The default engine :ref:`OEChargeEngineNoOp <OEProton_OEChargeEngineNoOp>` will use the pre-existing charges.



.. _OESz_OELigandOptOptions_SetNonBondCutoff:

   .. oe:method:: SetNonBondCutoff

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

         .. oe:api::

            bool SetNonBondCutoff(const double)

      .. oe:language:: python

         .. oe:api:: python

            SetNonBondCutoff(value: float) -> bool

      Sets the **Non-bonded interactions cutoff** for optimization.
      Setting a value of ``0.0`` or less assumes that all interactions should be
      included without any cutoff.
      Default: 0.0.



.. _OESz_OELigandOptOptions_SetGradTolerance:

   .. oe:method:: SetGradTolerance

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

         .. oe:api::

            bool SetGradTolerance(const double)

      .. oe:language:: python

         .. oe:api:: python

            SetGradTolerance(value: float) -> bool

      Sets the **gradient tolerance** for optimization. Default: 1.e-4.


.. _OESz_OELigandOptOptions_SetMaxIter:

   .. oe:method:: SetMaxIter

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

         .. oe:api::

            bool SetMaxIter(const unsigned)

      .. oe:language:: python

         .. oe:api:: python

            SetMaxIter(value: int) -> bool

      Sets the number of maximum iterations for optimization Default: 400



.. _OESz_OELigandOptOptions_SetSolventModel:

   .. oe:method:: SetSolventModel

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

         .. oe:api::

            bool SetSolventModel(const unsigned)

      .. oe:language:: python

         .. oe:api:: python

            SetSolventModel(value: int) -> bool

      Sets the type of solvent model used for the calculations of
      solution ligands, as an `unsigned int`
      from the :oe:constns:`OESz::OESolventModel` namespace.
      Method returns ``false`` when the invalid selection is chosen, ``true``
      otherwise.
      Default is :oe:const:`OESz::OESolventModel::NoSolv`


