Stores parameters for an elastic potential (harmonic distance restraint) between a pair of atoms.
More...
Stores parameters for an elastic potential (harmonic distance restraint) between a pair of atoms.
- See also
- ForceField.calcElasticPotentialEnergy()
- Since
- 1.1
◆ __init__() [1/2]
Initializes a copy of the ElasticPotential instance pot.
- Parameters
-
| pot | The ElasticPotential instance to copy. |
◆ __init__() [2/2]
| None CDPL.ForceField.ElasticPotential.__init__ |
( |
int |
atom1_idx, |
|
|
int |
atom2_idx, |
|
|
float |
force_const, |
|
|
float |
ref_length |
|
) |
| |
Constructs the elastic potential between atoms atom1_idx and atom2_idx with the specified force constant and reference length.
- Parameters
-
| atom1_idx | The zero-based index of the first restrained atom. |
| atom2_idx | The zero-based index of the second restrained atom. |
| force_const | The force constant k of the harmonic potential. |
| ref_length | The reference length \( r_0 \) of the harmonic potential. |
◆ getAtom1Index()
| int CDPL.ForceField.ElasticPotential.getAtom1Index |
( |
| ) |
|
Returns the zero-based index of the first atom.
- Returns
- The first atom index.
◆ getAtom2Index()
| int CDPL.ForceField.ElasticPotential.getAtom2Index |
( |
| ) |
|
Returns the zero-based index of the second atom.
- Returns
- The second atom index.
◆ getForceConstant()
| float CDPL.ForceField.ElasticPotential.getForceConstant |
( |
| ) |
|
Returns the force constant of the potential.
- Returns
- The force constant k.
◆ getReferenceLength()
| float CDPL.ForceField.ElasticPotential.getReferenceLength |
( |
| ) |
|
Returns the reference length of the potential.
- Returns
- The reference length \( r_0 \).
◆ setReferenceLength()
| None CDPL.ForceField.ElasticPotential.setReferenceLength |
( |
float |
length | ) |
|
Sets the reference length of the potential.
- Parameters
-
| length | The new reference length \( r_0 \). |
◆ assign()
Replaces the current state of self with a copy of the state of the ElasticPotential instance pot.
- Parameters
-
| pot | The ElasticPotential instance to copy. |
- Returns
- self
◆ getObjectID()
| int CDPL.ForceField.ElasticPotential.getObjectID |
( |
| ) |
|
Returns the numeric identifier (ID) of the wrapped C++ class instance.
Different Python ElasticPotential instances may reference the same underlying C++ class instance. The commonly used Python expression a is not b thus cannot tell reliably whether the two ElasticPotential instances a and b reference different C++ objects. The numeric identifier returned by this method allows to correctly implement such an identity test via the simple expression a.getObjectID() != b.getObjectID().
- Returns
- The numeric ID of the internally referenced C++ class instance.