TabulatedBondPotential

class TabulatedBondPotential(particleType1, particleType2, fileName, splineType=None)

Constructor of the potential.

Parameters:
  • particleType1 (ParticleType or ParticleIdentifier) – Identifier of the first particle type.

  • particleType2 (ParticleType or ParticleIdentifier) – Identifier of the second particle type.

  • fileName (str) –

    The name of the file that holds the spline data. It must be a text file that stores the spline in the following way for not hermitian:

    numPoints distance
    <energy at 0 * distance>
    <energy at 1 * distance>
    ...
    <energy at (numPoints-1) * distance>
    

    and for hermitian:

    numPoints distance dfactor
    <energy at 0 * distance>  <denergy/dr at 0 * distance>
    <energy at 1 * distance>  <denergy/dr at 1 * distance>
    ...
    <energy at (numPoints-1) * distance>  <denergy/dr at (numPoints-1) * distance>
    

    where dfactor is used as a prefactor for the denergy/dr values

  • splineType – The spline interpolation that will be used. Must be one of the following variables: TabulatedBondPotential.akima, TabulatedBondPotential.bessel, TabulatedBondPotential.fivepoint, TabulatedBondPotential.hermitian, TabulatedBondPotential.natural.

classmethod getAllParameterNames()

Return the names of all used parameters as a list.

getAllParameters()

Return all parameters of this potential and their current values as a <parameterName / parameterValue> dictionary.

static getDefaults()

Get the default parameters of this potential and return them in form of a dictionary of <parameter name, default value> key-value pairs.

getParameter(parameterName)

Get the current value of the parameter parameterName.

setParameter(parameterName, value)

Set the parameter parameterName to the given value.

Parameters:
  • parameterName (str) – The name of the parameter that will be modified.

  • value – The new value that will be assigned to the parameter parameterName.

Notes

  • This potential class is a bonded potential. This means it requires a bond topology to be specified on the configuration which the potential should be used for. Bonds can be set using the findBonds() method on configurations (MoleculeConfiguration, BulkConfiguration, DeviceConfiguration, or SurfaceConfiguration), which automatically adds bonds for atoms which are closer than their combined covalent radii (multiplied by a fuzz_factor of 1.1 by default). Alternatively bonds can be set manually by passing a list of the atom index pairs that form the bonds to the setBonds() method on the configuration. If no bonds are specified on the configuration bonded potentials have no effect.

This potential is a tabulated potential for bond stretch interactions, that is read from a file. The tabulated file must be present in your project directory, otherwise the correct path has to be given.

The first line of the file must contain two entries:

  • The number of data points \(N\) of the tabulation.

  • The distance \(\Delta r\) between two data points.

The following \(N\) lines must contain the potential energy values \(E_i, (i=1...N)\), representing the energy at a particle distance \(r=i\Delta r\) .

Possible spline types are

  • hermitian

  • bessel

  • akima

  • natural

  • fivepoint

If hermitian splines are used, a second column is required in the potential file, which contains the derivative values.