HPMC wall potential.


Wall potentials HPMC simulations.

Set \(U_{\mathrm{external},i}\) evaluated in hoomd.hpmc.integrate.HPMCIntegrator to a hard particle-wall interaction.

class hoomd.hpmc.external.wall.WallPotential(walls)

Bases: ExternalField

HPMC wall potential.


walls (list [hoomd.wall.WallGeometry ]) – A list of wall definitions that confine particles to specific regions of space.

WallPotential adds hard walls to HPMC simulations. Define the wall geometry with a collection of wall.WallGeometry objects. These walls break space into forbidden and allowed regions, controlled by the inside argument for spherical and cylindrical walls and the normal argument for planar walls. HPMC rejects trial moves that cause any part of the particle’s shape to enter the the space defined by the points with a negative signed distance from any wall in the collection. Formally, the contribution of the particle-wall interactions to the potential energy of the system is given by

\[U_{\mathrm{walls}} = \sum_{i=0}^{N_{\mathrm{particles}-1}} \sum_{j=0}^{N_{\mathrm{walls}-1}} U_{i,j},\]

where the energy of interaction \(U_{i,j}\) between particle \(i\) and wall \(j\) is given by

\[\begin{split}U_{i,j} = \begin{cases} \infty & d_{i,j} <= 0 \\ 0 & d_{i,j} > 0 \\ \end{cases}\end{split}\]

where \(d_{i,j} = \min{\{(\vec{r}_i - \vec{r}_j) \cdot \vec{n}_j : \vec{r}_i \in V_I, \vec{r}_j \in W_J\}}\) is the minimum signed distance between all pairs of points \(\vec{r}_i\) on the body of the particle \(V_I\) and \(\vec{r}_j\) on the surface of the wall \(W_J\) and \(\vec{n}_j\) is the vector normal to the surface of the wall at \(\vec{r}_j\) pointing to the allowed region of space defined by the wall.

Walls are enforced by the HPMC integrator. Assign a WallPotential instance to hpmc.integrate.HPMCIntegrator.external_potential to activate the wall potential. Not all combinations of HPMC integrators and wall geometries have overlap checks implemented, and a NotImplementedError is raised if a wall geometry is attached to a simulation with a specific HPMC integrator attached and the overlap checks between the specific shape and wall geometry are not implemented. See the individual subclasses of hoomd.hpmc.integrate.HPMCIntegrator for their wall support.


WallPotential does not support execution on GPUs.

See also



mc = hoomd.hpmc.integrate.Sphere()
walls = [hoomd.wall.Sphere(radius=4.0)]
wall_potential = hoomd.hpmc.external.wall.WallPotential(walls)
mc.external_potential = wall_potential
property overlaps

The total number of overlaps between particles and walls.

(Loggable: category=”scalar”)



property walls

The wall geometries associated with this potential.


list [hoomd.wall.WallGeometry]