Linear

class hoomd.hpmc.external.Linear(default_alpha=None, plane_origin=(0, 0, 0), plane_normal=(0, 1, 0))

Bases: External

Linear external potential (HPMC).

Parameters:
  • default_alpha (float) – Default value for alpha \([\mathrm{energy}] [\mathrm{length}]^{-1}\)

  • plane_origin ([float, float, float]) – A point on the plane of 0 energy.

  • plane_normal ([float, float, float]) – A vector perpendicular to the plane of 0 energy.

Linear computes a linear external potential on all particles in the simulation state:

\[U_{\mathrm{external},i} = \alpha_i \cdot \vec{n} \cdot ( \vec{r}_i - \vec{p} )\]

where \(\alpha_i\) (alpha) is the linear energy coefficient , \(\vec{n}\) is the normal vector to the plane (plane_normal), and \(\vec{p}\) is the plane origin (plane_origin):

Example

linear = hoomd.hpmc.external.Linear()
linear.alpha["A"] = 0.2
simulation.operations.integrator.external_potentials = [linear]

Members inherited from External:

property energy

Potential energy contributed by this potential \([\mathrm{energy}]\). Read more...


Members defined in Linear:

alpha

The linear energy coefficient \(\alpha\) by particle type.

Type: TypeParameter [tuple [particle_type, particle_type], float]

plane_origin

A point on the plane where the energy is zero.

Type: (float, float, float)

plane_normal

A unit length vector perpendicular to the plane where the energy is zero.

Type: (float, float, float)