Plane

class hoomd.wall.Plane(origin, normal, open=True)

Bases: WallGeometry

A plane.

Parameters:
  • origin (tuple [float, float, float]) – A point that lies on the plane \([\mathrm{length}]\).

  • normal (tuple [float, float, float]) – The normal vector to the plane. The vector will be converted to a unit vector \([\mathrm{dimensionless}]\).

  • open (bool, optional) – Whether to include the surface of the plane in the space. True means do not include the surface, defaults to True.

The signed distance from the wall surface is:

\[d = \hat{n} \cdot \left( \vec{r} - \vec{r}_o \right)\]

where \(\vec{r}\) is the particle position, \(\vec{r}_o\) is the origin of the plane, and \(\hat{n}\) is the plane’s unit normal. The normal points toward the points with a positive signed distance to the plane.

Warning

When running MD simulations in 2D simulation boxes, set normal=(nx,ny,0). Otherwise, the wall force will push particles off the xy plane.

Note

Plane objects are immutable.

Example:

plane = hoomd.wall.Plane(origin=(-10, 0, 0), normal=(1, 0, 0))
origin

A point that lies on the plane \([\mathrm{length}]\).

Type:

tuple [float, float, float]

normal

The unit normal vector to the plane.

Type:

tuple [float, float, float]

open

Whether to include the surface of the plane in the space. True means do not include the surface.

Type:

bool

__repr__()

A string representation of the Plane.

__str__()

A string representation of the Plane.

to_dict()

Convert the wall geometry to a dictionary defining the plane.

Returns:

The geometry in a Python dictionary.

Return type:

dict