hoomd.hpmc.external.wall#
Overview
HPMC wall potential. |
Details
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.
- Parameters:
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 ofwall.WallGeometry
objects. These walls break space into forbidden and allowed regions, controlled by theinside
argument for spherical and cylindrical walls and thenormal
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 tohpmc.integrate.HPMCIntegrator.external_potential
to activate the wall potential. Not all combinations of HPMC integrators and wall geometries have overlap checks implemented, and aNotImplementedError
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 ofhoomd.hpmc.integrate.HPMCIntegrator
for their wall support.Note
WallPotential
does not support execution on GPUs.See also
Example:
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”)- Type:
- property walls#
The wall geometries associated with this potential.
- Type: