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

.. oe:namespace:: OEMolPotential



.. _OEMolPotential_OEStretchParams:

.. oe:class:: OEStretchParams

   .. attention::

      |TWOLANGUAGE|

   .. oe:api::


      class  OEStretchParams : public OEMolPotential::OEInteractParams

   The :ref:`OEStretchParams <OEMolPotential_OEStretchParams>` class defines generic bond stretch parameters
   used in any force field which has bond stretch term.

   The following methods are publicly inherited from :ref:`OEInteractParams <OEMolPotential_OEInteractParams>`:
    * :oe:meth:`Clear<OEMolPotential::OEInteractParams::Clear>`
    * :oe:meth:`Get<OEMolPotential::OEInteractParams::Get>`
    * :oe:meth:`Set<OEMolPotential::OEInteractParams::Set>`

   The :ref:`OEStretchParams <OEMolPotential_OEStretchParams>` class defines the following public methods:
    * :oe:meth:`GetAtomIndex1<OEMolPotential::OEStretchParams::GetAtomIndex1>`
    * :oe:meth:`GetAtomIndex2<OEMolPotential::OEStretchParams::GetAtomIndex2>`
    * :oe:meth:`IsValid<OEMolPotential::OEStretchParams::IsValid>`
    * :oe:meth:`IsBond<OEMolPotential::OEStretchParams::IsBond>`


   .. oe:method:: Constructors

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

         .. oe:api::

            OEStretchParams(const OEChem::OEBondBase* bond,
                            const unsigned type = OEFormatType::AMBER)
            OEStretchParams(const OEStretchParams&)

      .. oe:language:: python

         .. oe:api:: python

            OEStretchParams(bond: OEBondBase, type: int) -> OEStretchParams
            OEStretchParams(arg2: OEStretchParams) -> OEStretchParams

      Constructor and copy constructor.
      Constructs an :ref:`OEStretchParams <OEMolPotential_OEStretchParams>` object for the bond passed as argument.

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

      .. oe:api::

         OEStretchParams& operator=(const OEStretchParams&)

      The assignment operator.

      Assignment operator.


   .. oe:method:: GetAtomIndex1

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

         .. oe:api::

            unsigned GetAtomIndex1() const

      .. oe:language:: python

         .. oe:api:: python

            GetAtomIndex1() -> int

      Returns atom index of the first atom making a bond for which the instance of
      :ref:`OEStretchParams <OEMolPotential_OEStretchParams>` was created.

   .. oe:method:: GetAtomIndex2

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

         .. oe:api::

            unsigned GetAtomIndex2() const

      .. oe:language:: python

         .. oe:api:: python

            GetAtomIndex2() -> int

      Returns atom index of the second atom making a bond for which the instance of
      :ref:`OEStretchParams <OEMolPotential_OEStretchParams>` was created.

   .. oe:method:: IsValid

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

         .. oe:api::

            bool IsValid(const OESystem::OEUnaryPredicate<OEChem::OEAtomBase>& pred) const
            bool IsValid(const OESystem::OEUnaryPredicate<OEChem::OEBondBase>& pred) const

      .. oe:language:: python

         .. oe:api:: python

            IsValid(pred: OEUnaryAtomPred) -> bool
            IsValid(pred: OEUnaryBondPred) -> bool

      Methods which check if an instance of the :ref:`OEStretchParams <OEMolPotential_OEStretchParams>`
      class was created for a bond to be included in force field calculation. The first 
      method provides a predicate which tests each of the 2 atoms belonging to a bond
      for which the above instance was created, while the second method provides a 
      predicate which tests a particular bond. 

   .. oe:method:: IsBond

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

         .. oe:api::

            bool IsBond(const OEChem::OEBondBase* bond) const

      .. oe:language:: python

         .. oe:api:: python

            IsBond(bond: OEBondBase) -> bool

      Used to check if the bond passed as an argument belongs to the current 
      :ref:`OEStretchParams <OEMolPotential_OEStretchParams>` instance.
       

 
