The Potential section¶
The potential section specifies a single
potential function to add to the force field.
potential = [
{ class = "DoubleWell", parameter = { a = 1.0, b = 2.0, c = 0.0 } },
]
In order to add several potential functions to a force
field, several [[potential]] tables can be added:
[[potential]]
class = "PairLennardJonesCutnp"
shift = true
dim = 2
mixing = "geometric"
[potential.parameter.0]
sigma = 1.0
epsilon = 1.0
factor = 1.12246205
[potential.parameter.1]
sigma = 1.0
epsilon = 1.0
factor = 1.12246205
[[potential]]
class = "DoubleWellWCA"
dim = 2
[potential.parameter]
rzero = 1.122462048309373
height = 15.0
width = 0.5
types = [
[
1,
1,
],
]
As the different potentials typically require different settings, detailed information can be found below for specific potentials:
The DoubleWell potential¶
This class defines a one-dimensional double well potential. The potential energy (\(V_\text{pot}\)) is given by
where \(x\) is the position and \(a\), \(b\) and \(c\) are parameters for the potential.
potential = [
{ class = "DoubleWell", parameter = { a = 1.0, b = 2.0, c = 0.0 } },
]
Keywords for the DoubleWell potential¶
The following keywords can be specified for the DoubleWell potential:
Keyword |
Description |
|---|---|
Selects the DoubleWell potential. |
|
Sets the parameters for the potential. |
Keyword class¶
This keyword selects the potential and should be set to: DoubleWell.
Keyword parameter¶
For the DoubleWell potential, three parameters can be specified:
The a parameter in the potential energy function
given above.
- Default:
The default is
a = 1.0.
The b parameter in the potential energy function
given above.
- Default:
The default is
b = 1.0.
The c parameter in the potential energy function
given above.
- Default:
The default is
c = 0.0.
The RectangularWell potential¶
This class defines a one-dimensional rectangular well potential. The potential energy is zero within the potential well and infinite outside. The well is defined with a left and right boundary.
potential = [
{ class = "RectangularWell", parameter = { left = -1.0, right = 1.0 } },
]
Keywords for the RectangularWell potential¶
The following keywords can be specified for the RectangularWell potential:
Keyword |
Description |
|---|---|
Selects the RectangularWell potential. |
|
Sets the parameters for the potential. |
Keyword class¶
This keyword selects the potential and should be set to: RectangularWell.
Keyword parameter¶
For the RectangularWell potential, two parameters can be set.
The left border for the potential well function.
The
potential energy is 0 for positions \(x\) such that
\(\text{left} < x < \text{right}\).
- Default:
The default is
left = 0.0.
The right border for the potential well function.
The
potential energy is 0 for positions \(x\) such that
\(\text{left} < x < \text{right}\).
- Default:
The default is
right = 1.0.
The PairLennardJonesCutnp potential¶
This class implements as simple Lennard-Jones 6-12 potential which employs a simple cut-off and can be shifted. The potential energy (\(V_\text{pot}\)) is defined in the usual way for an interacting pair \((i,j)\) of particles a distance \(r\) apart,
where \(x = \sigma_{ij}/r\) and \(\varepsilon_{ij}\) and \(\sigma_{ij}\) are the potential parameters.
Here is an example for defining parameters for a mixture of 3 particle types with geometric mixing.
[[potential]]
class = "PairLennardJonesCutnp"
shift = true
dim = 3
mixing = "geometric"
[potential.parameter.0]
sigma = 1.0
epsilon = 1.0
rcut = 2.5
[potential.parameter.1]
sigma = 1.2
epsilon = 1.1
rcut = 2.5
[potential.parameter.2]
sigma = 1.4
epsilon = 0.9
rcut = 2.5
Keywords for the PairLennardJonesCutnp potential¶
The following keywords can be specified for the PairLennardJonesCutnp potential:
Keyword |
Description |
|---|---|
Selects the potential. |
|
Set the number of dimensions to consider. |
|
Determines if the potential should be shifted. |
|
Selects the mixing rules for generating parameters for cross interactions. |
|
Sets the parameters for the potential. |
Keyword class¶
This keyword selects the potential and should be set to: PairLennardJonesCutnp.
Keyword dim¶
Sets the dimensionality for the potential. Should be 1, 2, or 3 for 1D, 2D or 3D, respectively.
- Default:
The default value is
dim = 3.
Keyword shift¶
Determines if the potential should be shifted or not. This
should be either true (enables shifting) or false (disables
shifting). If shifting is true, the following value is subtracted
from the potential (for a given \((i, j)\) pair), which makes it
zero at the cut-off:
where \(x_{\text{c}} = \sigma_{ij} / r_{\text{c}, ij}\) and \(r_{\text{c}, ij}\) is the cut-off.
- Default:
The default value is
shift = true.
Keyword mixing¶
Determines how the parameters of a pair of two different particle types \((i, j)\) are obtained from the parameters of each type. The supported mixing rules are:
mixing = "geometric":\(\epsilon_{ij} = \sqrt{\epsilon_{i} \times \epsilon_{j}}\)
\(\sigma_{ij} = \sqrt{\sigma_{i} \times \sigma_{j}}\)
\(r_{\text{c},ij} = \sqrt{r_{\text{c},i} \times r_{\text{c},j}}\)
mixing = "arithmetic":\(\epsilon_{ij} = \sqrt{\epsilon_{i} \times \epsilon_{j}}\)
\(\sigma_{ij} = \frac{\sigma_{i} + \sigma_{j}}{2}\)
\(r_{\text{c},ij} = \frac{r_{\text{c},i} + r_{\text{c},j}}{2}\)
mixing = "sixthpower":\(\epsilon_{ij} = 2 \sqrt{\epsilon_{i} \times \epsilon_{j}} \frac{\sigma_i^3 \times \sigma_j^3}{\sigma_i^6 + \sigma_j^6}\)
\(\sigma_{ij} = \left( \frac{\sigma_{i}^6 + \sigma_{j}^6}{2} \right)^{1/6}\)
\(r_{\text{c},ij} = \left(\frac{r_{\text{c},i}^6 + r_{\text{c},j}^6}{2}\right)^{1/6}\)
The value is one of these three, in lower case. The settings parse
refuses any other value, "Sixthpower" among them, in a
[[potential]] section of a PyRETIS potential (a section with no
module key), and the message names the three values. A
PairLennardJonesCut (or a subclass, such as the potential
of a user module) refuses it when it is created, and
generate_pair_interactions() checks it even when the
parameters give every cross pair. An rst input that sets
mixing = None gives no mixing key, as for any key set to
None: the run uses the default, "geometric".
- Default
The default value is
mixing = "geometric".
Keyword parameter¶
The following parameters can be set for the PairLennardJonesCutnp potential:
The parameters for the PairLennardJonesCutnp potentials are given for each particle type
on the form:
[[potential]]
class = "PairLennardJonesCutnp"
[potential.parameter.0]
sigma = 1.0
epsilon = 1.0
rcut = 2.5
Where i is the particle type, identified as an integer. Here, sigma is
\(\sigma_i\), epsilon is \(\varepsilon_i\) and rcut is \(r_{\text{c},i}\).
Note that several parameters can be given in this way and that they will be combined according to the selected mixing rule.
The DoubleWellWCA potential¶
This class defines a n-dimensional Double Well potential. The potential energy (\(V_\text{pot}\)) for a pair of particles separated by a distance \(r\) is given by,
where \(h\) gives the ‘height’ of the potential, \(r_0\) the minimum and \(w\) the width.
[[potential]]
class = "DoubleWellWCA"
dim = 2
[potential.parameter]
rzero = 1.122462048309373
height = 6.0
width = 0.25
types = [
[
1,
1,
],
]
Keywords for the DoubleWellWCA potential¶
The following keywords can be specified for the DoubleWellWCA potential:
Keyword |
Description |
|---|---|
Selects the potential. |
|
Sets the number of dimensions to consider. |
|
Sets the parameters for the potential. |
Keyword class¶
Selects the potential, should be set to: DoubleWellWCA.
Keyword dim¶
Sets the dimensionality for the potential. Should be 1, 2, or 3 for 1D, 2D or 3D, respectively.
- Default:
The default value is
dim = 3.
Keyword parameter¶
The following parameters can be set for the DoubleWellWCA potential:
This is the \(r_0\) parameter in the potential energy function given above.
- Default
The default is
rzero = 0
This is the \(h\) parameter in the potential energy function given above.
- Default
The default is
height = 0
This is the \(w\) parameter in the potential energy function given above.
- Default
The default is
width = 0
The pairs of particle types the interaction acts on. For example,
types = [[1, 2]] turns the interaction on between particles of
type 1 and type 2 only. (See the
particle section for a
description of the particle type.) Several pairs can be given at the
same time: types = [[1, 2], [0, 1], [0, 2]].
- Default
No pair: without
types, the interaction acts on no pair of particles, and this potential adds no energy and no force.
User-defined potential functions¶
User-defined potential functions are selected as follows:
[[potential]]
class = "PotentialName"
module = "potential.py"
keyword1 = "value"
[potential.parameter]
p = 123.0
Here, the user can both define custom keywords and parameters. However,
the class and the module must always be specified in this case.
Keywords for user-defined potential functions¶
At least, the following keywords can be specified for user-defined potential functions:
Keyword |
Description |
|---|---|
Selects the Python class which implements the potential. |
|
Defines the file where the Python class with the potential can be found. |
Keyword class¶
This keyword selects the potential function and it should be set to the class name of the custom potential function class defined in the given module.
Keyword module¶
This keyword specified the location of the file containing the user-defined class for the potential function. This file must be accessible by PyRETIS.
- Default
Not any. This keyword must be specified.